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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
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.
 

b34r

New Member
Joined
Mar 17, 2009
Messages
8
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!
 

b34r

New Member
Joined
Mar 17, 2009
Messages
8
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?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650

ADVERTISEMENT

Try

=IF(OR(ISNUMBER(SEARCH("B",A1)),ISNUMBER(SEARCH("C",A1))),1,0)
 

uk747

Well-known Member
Joined
Jul 20, 2011
Messages
746
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

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)
 

uk747

Well-known Member
Joined
Jul 20, 2011
Messages
746
Office Version
  1. 365
Platform
  1. Windows
just checked and noticed Finds its case sensitive, is that the only difference
 

PhilthePlanner

New Member
Joined
Jun 16, 2016
Messages
2
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,675
Messages
5,838,714
Members
430,566
Latest member
ChanchalSingh

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