Multiple IF statements in one cell?

sunshine1185

New Member
Joined
Jun 17, 2012
Messages
2
I have a statement that looks as follows:

=IF(ISERROR(SEARCH("[A]", [CELL])),"","")

Where A is the term that you are looking for and B is what you want written in the cell if A is found.

I hope this makes sense. I need to basically search for more than one A, giving me another B answer along with each A. How would I do this? Please let me know if I need to clarify anything but any help is greatly appreciated!
 

Some videos you may like

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

TheCman81

Well-known Member
Joined
Feb 28, 2012
Messages
535
Something like this

=IF(ISERROR(SEARCH(AND("[A]","[A]","[A]","[A]",[CELL])),"","")

If they all need to match what you are searching for then use AND, if only some then use OR
 

sunshine1185

New Member
Joined
Jun 17, 2012
Messages
2
Something like this

=IF(ISERROR(SEARCH(AND("[A]","[A]","[A]","[A]",[CELL])),"","")

If they all need to match what you are searching for then use AND, if only some then use OR


Unfortunately this did not work.. said I entered too many arguments for the function. Also how would I do this if I want each A to match up with its own B?
 

Soggy

Board Regular
Joined
May 16, 2012
Messages
188
I think I understand what you want but just in case here are three options with the last being what I think you want.

This one will tell you if it appears ion the cell:
=IF(ISERROR(FIND("[A]",[CELL],1))=FALSE,"","")

This one will tell you if it appears more than once:
=IF(LEN([CELL])-LEN(SUBSTITUTE([CELL],"[A]",""))>1,"","")

and this one will get you a result depending on how many times it occurs.
=IF(LEN([CELL])-LEN(SUBSTITUTE([CELL],"[A]",""))>0,VLOOKUP(LEN([CELL])-LEN(SUBSTITUTE([CELL],"[A]","")),$L$2:$M$16,2,0),"")
You will have to set up a range to lookup gainst I have as L2:M16 which is effectively your .

So L2 will be 1 and M2 will be and L3 will be 2 and M3 will be [C] and so on.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,481
Messages
5,596,395
Members
414,063
Latest member
N_Bates

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top