Strings And Wildcard Characters
Feb 21, 2007
I am attempting to set a value in a cell based on the content of another two cells. I want it set the value to 35 or 38 only if the txtProgram.Text contains Math*. Unfortunately, it always changes it to the Math value based on txtGrade.Text. What mistake am I making?
Application.Goto Reference:="SEFirstPass"
If txtGrade.Text Like "K" Or txtGrade.Text Like "1" Or txtGrade.Text Like "2" Then
ActiveCell = "27"
ElseIf txtGrade.Text Like "3" Or txtGrade.Text Like "4" Or txtGrade.Text Like "5" Or txtGrade.Text Like "6" Then
ActiveCell = "30"
End If....................
View 4 Replies
ADVERTISEMENT
Mar 12, 2013
I am trying to autofilter more than 2 criteria, for example 3 criteria.
Below code works fine as the criteria are exact match strings
VB:
ActiveSheet.Range("$A$1:$O$25").AutoFilter Field:=7, Criteria1:=Array( _
"=apple", "=orange", "=grape"), Operator:=xlFilterValues
However below code does not work when the criteria are strings with wildcard "*"
VB:
ActiveSheet.Range("$A$1:$O$25").AutoFilter Field:=7, Criteria1:=Array( _
"=*apple*", "=*orange*", "=*grape*"), Operator:=xlFilterValues
I need a wildcard * indicating strings contains instead of exact match the criteria.
Data looks like this
Fruits
apple, orange, peach
orange, strawberry
banana, peach
grape, peach
After autofilter, any rows that contains one of the criteria(in this case orange, apple, grape) will remain.
View 1 Replies
View Related
Oct 22, 2007
I'm trying to create 2 separate data sets based on year (06 vs. 07). To do so, I created a column and created an if then statement that populates with Yes If the date value is "like" 2006". Excel didn't like the ? or asterik. Is there some other syntax that will accomplish.
While I open to other approaches for filtering these 2 data sets, Ive been wondering for awhile about excel and wildcard logic.
View 9 Replies
View Related
May 17, 2014
get the name of the File in a Vlookup VBA using wildcard characters. I have to do a VLOOKUP from a specific file which is stored in the same folder as the file in which I need to get this VLOOKUP done, however the name can change anytime keep a word common only for this specific file...
Ex:
I have a File called "Mapping as on 8th May" from where i need to lookup some information for my file and I intend to do this using VLOOKUP in VBA in a Module but since the name can change to anything such as"Mapping as on 16th May" I cant use it in the VBA code, so is there a way around this where If I have this file stored in the same folder then I keep the word "Mapping" specific and unique for all other files in the same folder that the search can pull this file name to be further used in my lookup..
how to use the wildcards in VLOOKUP lookup range for the file name as the columns are going to remain the same...
View 13 Replies
View Related
Feb 2, 2010
Wildcard characters okay in countdiff and sumproduct? .......
View 9 Replies
View Related
Jul 10, 2012
I have a sheet with Names in it. I need to look those names up and find which org they belong to. The problem is the the names have many characters after them, and many names belong to a few orgs, with a the rest belonging to many orgs. (See below)
I have been trying to get a Vlookup to work, but since it can't go left, it won't look up the orgs that don't own at least three names. And I can't get the search to work on the names.
Names:
WSGHG1-8410YFH
WSSMXG-8401B8T
NBSMXG-0310V6R
NBXG-0310V6V
[code]....
View 4 Replies
View Related
Sep 8, 2006
There might be an easy solution for this, but I can't seem to figure it out. I'm trying to do a vlookup with the lookup value being #CFDMSMCSA*4. But the lookup table also has a value #CFDMSMCSAM4 in it.
It keeps returning the value for this #CFDMSMCSAM4 because of the * in the first string. Any ideas.
View 9 Replies
View Related
Jan 1, 1970
This doesn't work
View 13 Replies
View Related
Aug 1, 2007
I have a SS with 700 rows. 2 columns (Col K and L) may or may not contain text in their cells. If the cells do have text, I want to check for the presence of keywords which could be anywhere within the text, and if I find match write the matching word in Column I. Example: I want to seach for the following strings Loaned, injured, suspended etc ... in the range the K4-K700. Lets say Cell K50 contains the text Injured - broken bones. As the word injured is a match I want to write the word injured to cell I50 In addition if Cell K50 has text and Cell L50 does not, i want to put the text "NEW" in I50, and the reverse if Cell L50 has text and Cell K50 does not i want to put the text "recovered" in I 50. Following formula (in each cell in Col I) does this job currently. Can't figure out how to redo this in VBA, and wondering if checking the 700 rows will cause Vba to be slower.
=IF(OR(TEXT(LEFT(OFFSET(I22,0,2,1,1),6),"DDDDDD")="Loaned",TEXT(LEFT(OFFSET(I22,0,2,1,1),6),"DDDDDD")="Transf"),
"Loaned",
IF(ISNUMBER(SEARCH("susp",OFFSET(I22,0,2,1,1))),
"Suspended",
IF(AND(ISBLANK(OFFSET(I22,0,2,1,1)),ISBLANK(OFFSET(I22,0,3,1,1))),
"",
IF(ISTEXT(OFFSET(I22,0,2,1,1))=ISTEXT(OFFSET(I22,0,3,1,1)),
"Ongoing",
IF(ISTEXT(OFFSET(I22,0,2,1,1))=TRUE,
IF(ISTEXT(OFFSET(I22,0,3,1,1))=FALSE,
"New"),
"Recovered")))))
View 2 Replies
View Related
Dec 20, 2012
I need to do a vlookup that takes a string from one cell and then tries to find that string (embedded in a larger string) in the table array
Essentially I imagine this involves the FIND function at some point.
Attached is an incredibly simplified example of what I'm looking for.
View 9 Replies
View Related
Dec 16, 2013
I have an excel worksheet with about 10K rows of data in column A.
I have also another list of data, about 200 rows of data, in column G.
I need to color each cell in column A that contains, anywere in the string, any of the data strings in column G.
Example:
in column A
row 1: info@duende.com
row 2: rasko@silvester.com
row 3: supportonline@fabius.com
row 4: myhelp@friday.com
in column G:
row 1: help
row 2: info
row 3: support
I need rows 1, 3 and 4 in column A to be colored.
View 9 Replies
View Related
Jan 17, 2012
Is there an Excel formula to remove the spacebar + characters in red, as shown below? I need to be left with only the last name, first name and the semicolon.
Mouse, Mickey ;
Microsoft Outlook has changed the way that email addresses from the global addressbook copy and paste (from version 2003 to version 2010).
View 8 Replies
View Related
May 13, 2009
I'm trying to use conditional formatting to highlight cells in a column that have less than 8 characters.
I know the LAN function, but I don't know how to make it work for the conditional formatting.
View 9 Replies
View Related
Feb 21, 2009
Have a cell that says something like "123 main street".
I want the cell next to it to = Main if it detects main in the other cell and if not then it should say no. I tried this.
=if(B2="*main","Main","No"
However, it is not working.
View 9 Replies
View Related
Jun 7, 2006
I transferring data from the mainframe and some data has ????. I can not replace them with something else because excel think it is wildcard. The reason for this request is I was trying to count the number of cells that has ???? and the count was something different each time. If you want to have fun try it out. It will count ?, ??, ??? but not ????.However my question would be how to change this (????) to some thing like unknown...
For Each rngC In rngJbn
rngC = Trim(rngC)
If rngC.Value <> newvalue And rngC.Value <> "ab-" Then
'MsgBox "****" & rngC & "***"
Résultat = Application.CountIf(Range("C2:C" & Range("C" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible), rngC)
MsgBox rngC & " " & Résultat & " " & i
End If
newvalue = rngC.Value
Next
View 6 Replies
View Related
Nov 13, 2008
Is it possible to use the wildcard in an IF formula? For instance, I have a spreadsheet with text and numbers in the cells, the number of characters varies in the cells so a left, right or mid is out. I want the formula to look to the cell and if any part of the text contains "ABC" then I want to return 1. =IF(C18="*ABC*",1,"") Cell C18 containts the letters ABC in order but my formula is still returning blanks?
View 4 Replies
View Related
Aug 3, 2013
The idea
[Code] .....
Dropdown list
-------------
O11 = "Land" , "Sea"
P11 = "A - H" , "I - O" , P - Z"
Directory = C:MammalsLandA - HDate_120313 - Carnivore - Code_A3622
The list of filenames in the "A-H" folder has different dates and codes, how do I go about fixing wildcard *Carnivore* so that regardless of the date and code, there will be a match.
list of files in A-H folder
------------------------
Date_120313 - Carnivore - Code_A3622
Date_030213 - Herbivore - Code_A2231
Date_051212 - Hybrid - Code_A4431
View 10 Replies
View Related
Jun 23, 2014
How to use this wildcard in a IF statement.
[Code] ......
I have a column I'm adding a value to another cell if a piece of text is found in the column I'm looking in. The * is not working at all.
View 2 Replies
View Related
Aug 28, 2007
The use of * as a wildcard in excel can be extremely useful, however, can it be turned off? I work in the education sector and am currently number crunching GCSE results. When it comes to calculating A* grades versus A grades, B grades, etc, I cannot seem to do it because of the wildcard.
View 12 Replies
View Related
Dec 7, 2007
I have tried everything I can think of to get this to work.
I am searching column B for anything containing "Tease", then if found, look to see if column J contains a "W".
Excel doesn't report an error, but this doesn't work:
=SUMPRODUCT((B3:B40="*Tease*")*(J3:J40="W"))
View 10 Replies
View Related
May 1, 2009
Hi I have this formula:
View 3 Replies
View Related
Oct 31, 2011
As far as I know, a wildcard can't be used in an "if" statement. I have a list of "job names" that vary slightly from time to time. When we use a Bunnings "(building account) people give a job name such as "121 William Drive". Sometimes however, the person in the store spells it incorrectly. Is there a way to find a wildcard in the following manner?
Find any word that begins with "121" and ends in "ve"
In a1 it says: "121 wilaim jnes drive" I have tried the following formula in b1:
=IF(a1="121*ve","yes","no")
Why does it say "no"? Is there a formula for using wildcards in an "if" statement?
View 2 Replies
View Related
May 15, 2012
Trying to count how many cells in column b contain a value.
using
Application.WorksheetFunction.CountIf(Range("B:B"), "" * "")
getting a type mismatch error.
View 2 Replies
View Related
Mar 27, 2014
I was wondering is there away where i can lookup A:A anything begging with Ves* ? and then i need to copy the formula down to pick up the next one in the list
im guessing something like =VLOOKUP(A:A,"Ves*") but i havent got a clue
View 1 Replies
View Related
Feb 18, 2009
In a recent thread, I learnt how to import HTML, using ADO into Excel.
To import the relevant variables, my code is as below: ...
View 9 Replies
View Related
Jan 7, 2014
I need to lookup data from four different columns to match a value in another sheet. The lookup value has to start with "4" in order for it to be the correct match. I've tried the following formula for just two columns:
=IF(VLOOKUP($C2,'Sheet 1'!$D$2:$H$10000,5,FALSE)="4*",VLOOKUP($C2,'Sheet 1'!$D$2:$H$10000,5,FALSE),IF(VLOOKUP($C2,'Sheet 2'!$E$2:$G$10000,3,FALSE)="4*", VLOOKUP($C2,'Sheet 2'!$E$2:$G$10000,3,FALSE),"False"))
The problem I have is that the wildcard function isn't working in my If statement (apparentley that's how Excel was designed). The first vlookup returns the value "40042565" but Excel doesn't show it matching the criteria with the wildcard ("4*").
Any way to lookup the value in C2, search through multiple columns, and return the value that starts with "4"?
View 3 Replies
View Related
Feb 5, 2010
We have an ISP based antispam system which can sometimes incorrectly pickup messages as Spam. I would like to scan through all quarantined messages every week to check that this does not happen. I can export a report from the program to excel but what I would like to do is remove subject lines with common spam words (Viagra, Russian etc) so I don’t need to check these, this would in effect reduce the report by 85%.
Ideally the ‘spam word’ list would be on the second sheet as in example and could be added to as I find obvious words.
The ideal end result would either be all lines which have a word from the ‘Spamwords’ sheet are removed or all lines which do not match the words in the spam list are copied to a new sheet.
View 8 Replies
View Related
May 14, 2009
I've this question, how do i extract a part of the text using wildcard(example "ID=") in the string in the whole columns and copy to other columns or delete the unwanted.
Below is a example which i create for better understanding.
View 11 Replies
View Related
Feb 8, 2009
I'm trying to use a "WildCard" in an Array Formula to both simplify and handle variations in several formulas.
My work sheet is used for Time Cards. I have a tab for each of the 52 weeks in the year and each tab is labeled "W1", "W2" for Week 1, Week 2, etc.
On my SUMMARY tab, I'm using an array formula that looks at cell "'SUMMARY'!D6" for a project number, and than searches through all of the Week Tabs for anyone that has charged time against that project.
The employee would enter the project number in D12:D35 of a given weeks tab with each row representing a different task for that week. In some cases they may have several rows for the same project number.
On the SUMMARY tab, the formula for Week 1 is in cell E6. For Week 2 it's in F6, etc.
I was thinking I could simply place the sheet tab name in the row above (i.e. D5, E5, F5, etc., and then write the formula for 1 cell and copy it to all of the other cells on that row.
Currently my formula looks like:
{=IF($D$6="","",SUM(IF('W1'!$D$12:$D35=$D6,('W1'!$N$12:$N$35))))}
I was thinking the formula might look like:
{=IF($D$6="","",SUM(IF('&E5&'!$D$12:$D35=$D6,('&E5&'!$N$12:$N$35))))}
But that isn't working.
Additionally I was hoping to do something similar on the SUMMARY tab by referencing a different spreadsheet with something like:
='[&A1&]Sheet1'!$B$51
Where cell A1 has the value "Time Sheets - 01-17-09.xls"Currently the formula looks like:
='[Time Sheets - 01-17-09.xls]Sheet1'!$B$51
But this isn't working either.
View 10 Replies
View Related
Mar 31, 2009
I've been looking around for a way to use the countif function in excel with a wildcard, I have a excel list with a column containing data which looks like: ....
View 12 Replies
View Related