Formula if cell contains certain letter?

b34r

New Member
Joined
Mar 17, 2009
Messages
8
Is there a formula in 2003 I could use that let's me perform a different equation if a cell contains a certain letter? eg:

"3400A"
"3400B"

Is there a way to use the IF function to say "If cell contains letter "B", multiply it by "reference cell", if not, just leave it. ?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
You won't be able to multiply cells containing text but you could use something like

=IF(ISNUMBER(FIND("B",A1)),1,0)

which will return 1 if A1 contains B or 0 otherwise.
 
Upvote 0
oh, no, didnt mean to state i wanted to multiply the text cell...wanted to multiply a number cell by another number cell in the same row, which seemed to work - thanks!
 
Upvote 0
follow up question:

could i do the same thing, but say if the cell contains a "b" or a "c" then do something, if not, leave it?
 
Upvote 0
You won't be able to multiply cells containing text but you could use something like

=IF(ISNUMBER(FIND("B",A1)),1,0)

which will return 1 if A1 contains B or 0 otherwise.

whats the difference between

=IF(ISNUMBER(FIND("B",A1)),1,0) and
=IF(ISNUMBER(Search("B",A1)),1,0)
 
Upvote 0
just checked and noticed Finds its case sensitive, is that the only difference
 
Upvote 0
I'm no expert, but I think if you nest the Find function you could achieve that.

=IF(ISNUMBER(FIND("B",A1)),1,IF(ISNUMBER(FIND("C",A1)),2,0))

With a quick test it produced these results:

[TR] [TD]Input[/TD] [TD]Output[/TD] [/TR] [TR] [TD]310A[/TD] [TD]0[/TD] [/TR]
[TD]310B[/TD] [TD]1[/TD] [/TR]
[TD]310C[/TD] [TD]2[/TD] [/TR]


Hope this helps,

Phil
 
Upvote 0

Forum statistics

Threads
1,214,277
Messages
6,118,635
Members
448,844
Latest member
Jayee04e

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