View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Count only Mon-Thurs?

In your example B1 is not in the formula so changing B1 will do nothing.
Thanks, Peter. _Now_ I see that!

It's not clear under what condition(s) you want your CF in B1 to flag.

I'm trying to get B1 to turn yellow if the date in B1 is less than 3 days
from A1, but only counting days Mon-Thurs. So a date of 2/20/2007 in A1
should give me a yellow cell up to 2/26/2007 in B1, and a white cell after
that.

Ed

"Peter T" <peter_t@discussions wrote in message
...
I think you only need the one Weekday formula -

(Weekday(ref-date,3) <=3) ' true if Mon-Thurs

It's not clear under what condition(s) you want your CF in B1 to flag. In
your example B1 is not in the formula so changing B1 will do nothing.

Regards,
Peter T


"Ed" wrote in message
...
Chip:

Thanks for the help, but I'm not sure I know how to make this work.

I put 2/20/2007 in A1, 2/22/2007 in B1, and Conditional Formatting in B1
with Formula Is
="SUMPRODUCT((WEEKDAY(A1:A10)=2)*(WEEKDAY(A1:A10) <=5))<3"
should turn the cell yellow. It did not. I tried changing B1 to
2/27/2007 - still no go.

What did I miss?

Ed

"Chip Pearson" wrote in message
...
Ed,

For data validation and conditional formatting, use

=IF(AND(WEEKDAY(A1)=2,WEEKDAY(A1)<=5),TRUE,FALSE)

This returns True or False indicating whether A1 is between Monday and
Thursday.

To count the number of dates in A1:A10 that are between Monday and
Thursday, use

=SUMPRODUCT((WEEKDAY(A1:A10)=2)*(WEEKDAY(A1:A10)< =5))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Ed" wrote in message
...
I would like to create a Task Sheet with Due Dates. The Due Date would

be
a certain number of working days from the Order Date. Our work week is
four 10-hour days, Monday - Thursday. I wanted to set up a color-code

for
the Due Date with data validation, but got lost trying to figure out
how
to count only Mon-Thurs, or not count Fri, Sat and Sun?? Is this
easily
possible with validation? Or would a macro that evaluates each date on
open be better?

Ed