Solved

can you use wildcards in an if formula excel 2003

Posted on 2011-03-06
8
356 Views
Last Modified: 2012-08-13
I would like to use the wildcard * in an IF formula.   If cell A contains the string IND I would like it to populate in cell D, if cell A contains MV I would like it to populate column D, if neither is found in Cell A then I want the cells to be blank.  Are wildcards allowed in IF statements?  If so, what is the syntax and cell formatting to make the attach file work.

 expWildcard.xls
0
Comment
Question by:mossyback
  • 4
  • 2
  • 2
8 Comments
 
LVL 24

Expert Comment

by:jimyX
Comment Utility
You can use find instead, see the attachment:

expWildcard-updated.xls
0
 
LVL 24

Accepted Solution

by:
jimyX earned 250 total points
Comment Utility
Better use search because it is not case sensitive.
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
Do you just want the relevant number or the whole cell contents, e.g. what should be in C13 and D13?

If you want the whole cell contents in both then try this formula in C2 copied down and across and format to wrap text

=IF(ISNUMBER(SEARCH(C$1,$A2)),$A2,"")

see attached

If you want to extract the number from each so that C13 is 1 and D13 is 2 then that's another formula, how long will the numbers be...only single digits or longer?

see attached for that initial option....

regards, barry
26866774.xls
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
To extract just the numbers change to this formula

=IF(SEARCH(C$1,$A2&C$1)<LEN($A2),MID($A2,SEARCH(C$1,$A2)-2,1)+0,"")

regards, barry
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
This attachment illustrates that last formula......

barry
26866774v2.xls
0
 

Author Closing Comment

by:mossyback
Comment Utility
Thanks JimyX.  That did the trick!
0
 

Author Comment

by:mossyback
Comment Utility
barryhoudini  - Your solution is also interesting.  I might be able to use it on something else.  Good stuff!
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
In this formula

=IF(ISERROR(IF(FIND("IND",A3)>0,A3,"")),"",IF(FIND("IND",A3)>0,A3,""))

The IF functions are really redundant because either the value "IND" is found in A3....in which case the IF is TRUE.....or it isn't in which case the IF is never evaluated because FIND returns an error, so you have an IF function in whch the FALSE can never be returned. My suggested formula simply checks whether SEARCH (or FIND) returns a number or not, which is all you need.

regards, barry
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now