1. ## If statement (2007)

Hi All,
Further to my date/time grid, I want to calculate some values based on the contents of one cell. I have one row with a date in dd-mmm-yy format. The next row is in ddd format showing Mon for Monday Tue for Tuesday, etc. I want to do a test to see if the row with the ddd format says "Sat", then calculate based on that. In another cell, I have made an IF that looks to the ddd row for a value of "Sat" but it is not working. I am sure it has something to do with the IF looking for a text string. Does anyone have any ideas?

Thanks,
Mark

2. ## Re: If statement (2007)

With the date in cell A1 create a formula based on this:
<code>=IF(WEEKDAY(A1)=7,Calculation if Saturday, Calculation for other days)</code>

The cell that displays "Sat" still contains a date, the WEEKDAY function will result in 7 if it is a Saturday.

3. ## Re: If statement (2007)

Further to Tony's answer, it also depends how you treat your week. Some countries state Sunday is the first day of the week, whilst I treat Monday as the start.

Using Tony's formula:

=IF(WEEKDAY(A1,1)=7,Calculation if Saturday, Calculation for other days) , where Sunday is day 1 and Saturday day 7

or

=IF(WEEKDAY(A1,2)=6,Calculation if Saturday, Calculation for other days), where Monday is day 1 and Sunday day 7

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•