ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   WEEKDAY in Conditional Formatting? (https://www.excelbanter.com/excel-worksheet-functions/126637-weekday-conditional-formatting.html)

Ken

WEEKDAY in Conditional Formatting?
 
Excel2003 ... My Cols are A thru H =

Date - Mon - Tue - Wed - Thu - Fri - Sat - Sun

Cell A2 = a date (or is blank (empty)) ... format = mm/dd/yy
Cells B2 thru H2 contain Conditional Formatting as follows:

Cell B2 ... =if(weekday(A2,2)=1
Cell C2 ... =if(weekday(A2,2)=2
Cell D2 ... =if(weekday(A2,2)=3
Cell E2 ... =if(weekday(A2,2)=4
Cell F2 ... =if(weekday(A2,2)=5
Cell G2 ... =if(weekday(A2,2)=6 ... this one is a problem???
Cell H2 ... =if(weekday(A2,2)=7

All above are working ok, except ... =if(weekday(A2,2)=6 ... this formula in
Conditional Formatting is setting off the Conditional formatting when Col A
reference cell is BLANK (empty) ... Anyone know what gives?

Note: if I place "=6" in any of the other Cells it also sets off the
Conditional formatting when Col A reference cell is BLANK (empty)???

Thanks ... Kha



Bob Phillips

WEEKDAY in Conditional Formatting?
 
That is because a blank gets evaluated as day 0, which weekday sees as a
Saturday.

Try

=if(and(a2<"",weekday(A2,2)=6),

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ken" wrote in message
...
Excel2003 ... My Cols are A thru H =

Date - Mon - Tue - Wed - Thu - Fri - Sat - Sun

Cell A2 = a date (or is blank (empty)) ... format = mm/dd/yy
Cells B2 thru H2 contain Conditional Formatting as follows:

Cell B2 ... =if(weekday(A2,2)=1
Cell C2 ... =if(weekday(A2,2)=2
Cell D2 ... =if(weekday(A2,2)=3
Cell E2 ... =if(weekday(A2,2)=4
Cell F2 ... =if(weekday(A2,2)=5
Cell G2 ... =if(weekday(A2,2)=6 ... this one is a problem???
Cell H2 ... =if(weekday(A2,2)=7

All above are working ok, except ... =if(weekday(A2,2)=6 ... this formula

in
Conditional Formatting is setting off the Conditional formatting when Col

A
reference cell is BLANK (empty) ... Anyone know what gives?

Note: if I place "=6" in any of the other Cells it also sets off the
Conditional formatting when Col A reference cell is BLANK (empty)???

Thanks ... Kha





Teethless mama

WEEKDAY in Conditional Formatting?
 
=AND(A2<"",WEEKDAY(A2,2)=6)


"Ken" wrote:

Excel2003 ... My Cols are A thru H =

Date - Mon - Tue - Wed - Thu - Fri - Sat - Sun

Cell A2 = a date (or is blank (empty)) ... format = mm/dd/yy
Cells B2 thru H2 contain Conditional Formatting as follows:

Cell B2 ... =if(weekday(A2,2)=1
Cell C2 ... =if(weekday(A2,2)=2
Cell D2 ... =if(weekday(A2,2)=3
Cell E2 ... =if(weekday(A2,2)=4
Cell F2 ... =if(weekday(A2,2)=5
Cell G2 ... =if(weekday(A2,2)=6 ... this one is a problem???
Cell H2 ... =if(weekday(A2,2)=7

All above are working ok, except ... =if(weekday(A2,2)=6 ... this formula in
Conditional Formatting is setting off the Conditional formatting when Col A
reference cell is BLANK (empty) ... Anyone know what gives?

Note: if I place "=6" in any of the other Cells it also sets off the
Conditional formatting when Col A reference cell is BLANK (empty)???

Thanks ... Kha



Ken

WEEKDAY in Conditional Formatting?
 
Another "nail" in the coffin ... Thank you both ... Kha


"Teethless mama" wrote:

=AND(A2<"",WEEKDAY(A2,2)=6)


"Ken" wrote:

Excel2003 ... My Cols are A thru H =

Date - Mon - Tue - Wed - Thu - Fri - Sat - Sun

Cell A2 = a date (or is blank (empty)) ... format = mm/dd/yy
Cells B2 thru H2 contain Conditional Formatting as follows:

Cell B2 ... =if(weekday(A2,2)=1
Cell C2 ... =if(weekday(A2,2)=2
Cell D2 ... =if(weekday(A2,2)=3
Cell E2 ... =if(weekday(A2,2)=4
Cell F2 ... =if(weekday(A2,2)=5
Cell G2 ... =if(weekday(A2,2)=6 ... this one is a problem???
Cell H2 ... =if(weekday(A2,2)=7

All above are working ok, except ... =if(weekday(A2,2)=6 ... this formula in
Conditional Formatting is setting off the Conditional formatting when Col A
reference cell is BLANK (empty) ... Anyone know what gives?

Note: if I place "=6" in any of the other Cells it also sets off the
Conditional formatting when Col A reference cell is BLANK (empty)???

Thanks ... Kha




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

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