ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Need conditional formula (https://www.excelbanter.com/excel-worksheet-functions/107485-need-conditional-formula.html)

Dan Hale

Need conditional formula
 
I need a formula that will look in a cell that contains text and if that
text contains certain words the formula will return a value based on which
text it finds and example will be something like this:

The cell the formula looks at might contain the following:

Walgreens 1234 abc
CVS 5678 def
Target 9012 ghi
Babies R US 3456 jklmno

I need the formula to return a 60 if the cells contains WALGREENS OR CVS
return 120 if the cell contains Target or return 30 if the cell contains
Babies are us.

Any help would be greatly appreciated.

Thanks




Carim

Need conditional formula
 
Hi Dan,

Give it a try :

=IF(OR(COUNTIF(A1,"Walgreens*")=1,COUNTIF(A1,"CVS* ")=1),60,IF(COUNTIF(A1,"Target*")=1,120,IF(COUNTIF (A1,"Babies*")=1,30,0)))

HTH
Cheers
Carim


Bob Phillips

Need conditional formula
 
=IF(OR(ISNUMBER(SEARCH("WALGREENS",E5)),ISNUMBER(F IND("CVS",E5))),60,
IF(ISNUMBER(SEARCH("TARGET",E5)),120,
IF(ISNUMBER(SEARCH("Babies",E5)),30,"")))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dan Hale" wrote in message
...
I need a formula that will look in a cell that contains text and if that
text contains certain words the formula will return a value based on which
text it finds and example will be something like this:

The cell the formula looks at might contain the following:

Walgreens 1234 abc
CVS 5678 def
Target 9012 ghi
Babies R US 3456 jklmno

I need the formula to return a 60 if the cells contains WALGREENS OR CVS
return 120 if the cell contains Target or return 30 if the cell contains
Babies are us.

Any help would be greatly appreciated.

Thanks







All times are GMT +1. The time now is 12:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com