Text in an IF function

Hi All

I'm using a lot of IF functions in my Spreadsheets to limit DIV and NAME errors with rows that don't have values in them yet.

I came across a situation today where I need to test text - ie I need to test for a month's name.

I tried =IF(Cell Ref="AUG",do calculation."")
But this gives NAME error.
Is it possible to test text in this way? Can't find anything with a Google on this.

PClinuxOS KDE 32-bit (latest); LO 4.1.3.2

Thanks
IanW
Pretoria RSA

Hi,

I came across a situation today where I need to test text - ie I need to
test for a month's name.

If the referenced cell (say it's A1) contains a month name :

=IF(A1="AUG";doYes;doNo)

If the referenced cell contains a date formatted to display as a month
name (namely "MMMM"), then:

=IF(MONTH(A1)=8;doYes;doNo)

HTH,

Yes. The only thing wrong with your example is the dot separating the second and third arguments - which presumably should be a comma. There is nothing in the basic structure you are illustrating here that would stimulate a #NAME? error, so the problem must be in your cell reference or the "do calculation" - the parts you've not shown.

I trust this helps.

Brian Barker

Thanks Brian!! The dot separating the arguments was "finger trouble" when I wrote the eMail!!

I think I've tracked down the problem but not the answer....

My full statement is - =IF(H44="AUG",Paid.D21,"")

Paid.D21 is the value I want to insert if the month is correct.
H44 contains the month, ie AUG - and this seems to be the problem. It is a pull-down list of months.
If I enter the month by hand the IF statement works but with it being a pull-down list it does not work.

Is there a way round this??

Another off-the-top-of-my-head stab at the problem, but in a pull down
list, doesn't the cell maybe actually store the index of the list, so
assuming "JAN" is the first item in the list, "AUG" should be either
the 7th (zero-based list) or the 8th (1 based list) entry, so try:

=IF(H44=7,Paid.D21,"")

or

=IF(H44=8,Paid.D21,"")

Might not work, I haven't tested, just my first thought on the matter.

Paul

I think I've tracked down the problem but not the answer....

My full statement is - =IF(H44="AUG",Paid.D21,"")

Paid.D21 is the value I want to insert if the month is correct.
H44 contains the month, ie AUG - and this seems to be the problem. It is a pull-down list of months. If I enter the month by hand the IF statement works but with it being a pull-down list it does not work.

The only obvious possibility is that your selection list does not include exactly "AUG". Does it perhaps have a trailing blank or blanks? If so, either correct the list or modify the formula to refer to TRIM(H44) instead.

Brian Barker

Did you try inserting quots which will become =IF(H44="AUG","Paid.D21","") perhaps?
Joe Conner, Poulsbo, WA 98370