ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   help with an if statement (https://www.excelbanter.com/excel-worksheet-functions/64234-help-if-statement.html)

clegge

help with an if statement
 

1) basically would like to get the following statement to work:
=if(foo!H2=ssbs,"ssbs2","foo'!H2")
basically if fooH2 contains the value SSBS i need to return SSBS2 if it
does not i need to return the value that is presently in fooH2

2) if possiple i would like to make it a compound if ..
if foo!H2=ssbs, then return ssbs2, if foo!H2 = x then return x2, if
foo!H2=x then return x3

thank you in advance for all the help....


--
clegge
------------------------------------------------------------------------
clegge's Profile: http://www.excelforum.com/member.php...o&userid=29927
View this thread: http://www.excelforum.com/showthread...hreadid=499793


BenjieLop

help with an if statement
 

<< 1) basically would like to get the following statement to work:
=if(foo!H2=ssbs,"ssbs2","foo'!H2")
basically if fooH2 contains the value SSBS i need to return SSBS2 if it
does not i need to return the value that is presently in fooH2

=IF(FOO!H2=\"SSBS\",\"SSBS2\",FOO!H2)

<< 2) if possiple i would like to make it a compound if ..
if foo!H2=ssbs, then return ssbs2, if foo!H2 = x then return x2, if
foo!H2=x then return x3

THERE IS SOMETHING WRONG WITH THE LOGIC HERE. IF FOO!H2=X, IT CAN ONLY
RETURN EITHER X2 OR X3 BUT NOT BOTH. YOU HAVE TO PICK ONE AND ONLY ONE
OPTION IF FOO!H2=X.

ANYWAY, THIS FORMULA

=IF(FOO!H2=\"SSBS\",\"SSBS2\",IF(FOO!H2=\"X\",\"X2 \",ANY_VALUE)

WILL RETURN

\"SSBS2\" IF FOO!H2=\"SSBS\"
\"X2\" IF FOO!H2=\"X\"

AND WILL RETURN ANY VALUE IF FOO!H2 IS NEITHER \"SSBS\" NOR \"X\"

Regards.


--
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile: http://www.excelforum.com/member.php...o&userid=11019
View this thread: http://www.excelforum.com/showthread...hreadid=499793


clegge

help with an if statement
 

your right - i did not describe the scenario correctly... basically want
a formula that will return
ssbs2 if there is an ssbs value in h2..
an empty cell if there is a value of x in h2
an empty cell if there is a value of y in h2
an empty cell if there is a value of z in h2
if there is any other vaule in h2 i want the formula to show that
value....

hard to exlain... sory about that


thanks again....


--
clegge
------------------------------------------------------------------------
clegge's Profile: http://www.excelforum.com/member.php...o&userid=29927
View this thread: http://www.excelforum.com/showthread...hreadid=499793


BenjieLop

help with an if statement
 

clegge Wrote:
your right - i did not describe the scenario correctly... basically want
a formula that will return
ssbs2 if there is an ssbs value in h2..
an empty cell if there is a value of x in h2
an empty cell if there is a value of y in h2
an empty cell if there is a value of z in h2
if there is any other vaule in h2 i want the formula to show that
value....

hard to exlain... sory about that


thanks again....


=IF(H2=\"SSBS\",\"SSBS2\",IF(OR(H2=\"X\",H2=\"Y\", H2=\"Z\"),\"\",H2))

and if "h2" is the same as "foo!h2" in your original message, then
simply replace all "h2" with "foo!h2" in the above formula.

Regards.


--
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile: http://www.excelforum.com/member.php...o&userid=11019
View this thread: http://www.excelforum.com/showthread...hreadid=499793


clegge

help with an if statement
 

i think i wast trying to make things to complicated... i ended up using
a vlookup and it worked pretty well... i should have thought of that
from the start...

i am really bad at describing what i need to get done but here goes...

i am doing a vlookup... basically the criteria in *a1* is used against
*column b*, and if there is a hit, the corresponding value in *column
c* is displayed... is ther anyway to have this lookup just return the
originaly criteria *a1* if nothing matches in *column b*


--
clegge
------------------------------------------------------------------------
clegge's Profile: http://www.excelforum.com/member.php...o&userid=29927
View this thread: http://www.excelforum.com/showthread...hreadid=499793



All times are GMT +1. The time now is 05:05 PM.

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