If Thens

sammon28

New Member
Joined
Dec 13, 2006
Messages
14
I know this is probably easy, but I haven't been able to make it work. This is what I'm trying to do: If Cell M2 contains a certain string of Characters, I want it to return "Fund" if it does, and "Ad Hoc" if it doesn't. I've got it to where it will return Ad Hoc for everything but can't get it to return Fund no matter what changes I make. =IF(ISNUMBER(SEARCH("AZ",M2,)),M2,"Ad Hoc")

What am I doing wrong? I've tried replacing the 2nd M2 with lots of different things, but it doesn't ever come out right.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Looks like the extra comma is throwing out a VALUE error in SEARCH

=IF(ISNUMBER(SEARCH("AZ",M2,)),M2,"Ad Hoc")

Try:

=IF(ISNUMBER(SEARCH("AZ",M2)),M2,"Ad Hoc")
 
Upvote 0
Looks like the extra comma is throwing out a VALUE error in SEARCH

=IF(ISNUMBER(SEARCH("AZ",M2,)),M2,"Ad Hoc")

Try:

=IF(ISNUMBER(SEARCH("AZ",M2)),M2,"Ad Hoc")


So that makes it return the word "Ad Hoc" in the right cells, but it returns the ENTIRE M2 cell instead of the word "Fund". How do I get it to do that?
 
Upvote 0
How about
=IF(ISNUMBER(SEARCH("AZ",M2)),"Fund","Ad Hoc")
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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
Back
Top