ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF - AND Function (https://www.excelbanter.com/excel-worksheet-functions/148194-if-function.html)

Michael

IF - AND Function
 
Hi Folks - I'm trying to create an IF/AND function something like this ....

=if(and(a1="RI", c1="Sold"),"Property Sold", "For Sale")

Basically, if State = RI AND Status = Sold, then display appropriate text.
However, it seems that the AND function does not handle text as a logical
test. Any workarounds? Thanks,

Michael




Peo Sjoblom

IF - AND Function
 
Your formula is correct except that you want to add something if both cells
are empty, so I suspect that you might have hidden spaces. Does this work?

=IF(AND(TRIM(A1)="RI", TRIM(C1)="Sold"),"Property Sold", "For Sale")


if so you have extra spaces, if it still doesn't work you might have hidden
html characters or there is a typo somewhere


--
Regards,

Peo Sjoblom


"Michael" wrote in message
...
Hi Folks - I'm trying to create an IF/AND function something like this
....

=if(and(a1="RI", c1="Sold"),"Property Sold", "For Sale")

Basically, if State = RI AND Status = Sold, then display appropriate text.
However, it seems that the AND function does not handle text as a logical
test. Any workarounds? Thanks,

Michael






Michael

IF - AND Function
 
Yep .... there were stray spaces ..... Thanks.

Michael




"Peo Sjoblom" wrote in message
...
Your formula is correct except that you want to add something if both
cells are empty, so I suspect that you might have hidden spaces. Does this
work?

=IF(AND(TRIM(A1)="RI", TRIM(C1)="Sold"),"Property Sold", "For Sale")


if so you have extra spaces, if it still doesn't work you might have
hidden html characters or there is a typo somewhere


--
Regards,

Peo Sjoblom


"Michael" wrote in message
...
Hi Folks - I'm trying to create an IF/AND function something like this
....

=if(and(a1="RI", c1="Sold"),"Property Sold", "For Sale")

Basically, if State = RI AND Status = Sold, then display appropriate
text. However, it seems that the AND function does not handle text as a
logical test. Any workarounds? Thanks,

Michael








Peo Sjoblom

IF - AND Function
 
Should have been "you might want to add something"


--
Regards,

Peo Sjoblom


"Peo Sjoblom" wrote in message
...
Your formula is correct except that you want to add something if both
cells are empty, so I suspect that you might have hidden spaces. Does this
work?

=IF(AND(TRIM(A1)="RI", TRIM(C1)="Sold"),"Property Sold", "For Sale")


if so you have extra spaces, if it still doesn't work you might have
hidden html characters or there is a typo somewhere


--
Regards,

Peo Sjoblom


"Michael" wrote in message
...
Hi Folks - I'm trying to create an IF/AND function something like this
....

=if(and(a1="RI", c1="Sold"),"Property Sold", "For Sale")

Basically, if State = RI AND Status = Sold, then display appropriate
text. However, it seems that the AND function does not handle text as a
logical test. Any workarounds? Thanks,

Michael









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

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