ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   =IF(B8="M","HI") OK but =IF(B8="M","HI")+IF(B8="x","bye") not why (https://www.excelbanter.com/excel-discussion-misc-queries/130660-%3Dif-b8%3D-m-hi-ok-but-%3Dif-b8%3D-m-hi-if-b8%3D-x-bye-not-why.html)

Nater

=IF(B8="M","HI") OK but =IF(B8="M","HI")+IF(B8="x","bye") not why
 
I'm trying to enter a formula similar to
=IF(B1=0,"0")+IF(B1=1,A1*1)+IF(B1=2,A1*2)
but instead of A1*1 or 2 etc. I want the result to return a text response
such as
=IF(B1="Hi","Hello")+IF(B1="Bye","Good bye") but this results in an error.
What am I doing wrong?

Dave F

=IF(B8="M","HI") OK but =IF(B8="M","HI")+IF(B8="x","bye") not why
 
=IF(B1="Hi","Hello","Good bye")

This assumes that the only two possible values in B1 are "hi" or "bye".

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Nater" wrote:

I'm trying to enter a formula similar to
=IF(B1=0,"0")+IF(B1=1,A1*1)+IF(B1=2,A1*2)
but instead of A1*1 or 2 etc. I want the result to return a text response
such as
=IF(B1="Hi","Hello")+IF(B1="Bye","Good bye") but this results in an error.
What am I doing wrong?


Pete_UK

=IF(B8="M","HI") OK but =IF(B8="M","HI")+IF(B8="x","bye") not why
 
You can't add two text strings together - use & instead of + between
the two If statements.

Hope this helps.

Pete


On Feb 14, 3:22 pm, Nater wrote:
I'm trying to enter a formula similar to
=IF(B1=0,"0")+IF(B1=1,A1*1)+IF(B1=2,A1*2)
but instead of A1*1 or 2 etc. I want the result to return a text response
such as
=IF(B1="Hi","Hello")+IF(B1="Bye","Good bye") but this results in an error.
What am I doing wrong?




Don Guillett

=IF(B8="M","HI") OK but =IF(B8="M","HI")+IF(B8="x","bye") not why
 

try this idea
=if(b1=0,"joe","")&if(b2=1," played","")
but maybe you just want to nest em
if(b1=0,dothis,if(b1=1,dothat,""))
--
Don Guillett
SalesAid Software

"Nater" wrote in message
...
I'm trying to enter a formula similar to
=IF(B1=0,"0")+IF(B1=1,A1*1)+IF(B1=2,A1*2)
but instead of A1*1 or 2 etc. I want the result to return a text response
such as
=IF(B1="Hi","Hello")+IF(B1="Bye","Good bye") but this results in an error.
What am I doing wrong?




pinmaster

=IF(B8="M","HI") OK but =IF(B8="M","HI")+IF(B8="x","bye") not why
 
Hi,

Maybe this is what you're looking for:

=IF(B1="Hi","Hello",IF(B1="Bye","Good Bye",""))

HTH
Jean-Guy

"Nater" wrote:

I'm trying to enter a formula similar to
=IF(B1=0,"0")+IF(B1=1,A1*1)+IF(B1=2,A1*2)
but instead of A1*1 or 2 etc. I want the result to return a text response
such as
=IF(B1="Hi","Hello")+IF(B1="Bye","Good bye") but this results in an error.
What am I doing wrong?



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

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