Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2007

Tip: Looking for answers? Try searching our database.

need to compare dates and count the results

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Heather - 09 Mar 2007 16:34 GMT
I have two columns of dates.  The first column is the date the event
actually occurred or is 0 if nothing has been done yet.  The second column
is the target date by which the event should happen, the deadline.

I was able to create conditional formatting for the first column.  It turns
each date green if the task was complete or if the due date was more than 24
hours from today.  The date turns yellow if it is incomplete and the due
date is 24 hours from today.  The date turns red if it's incomplete, and
it's target date is today or has passed.

I would now like to be able to add up how many dates are green, how many are
yellow, and how many are red. Can I count cells based on their format color?
I couldn't figure out a way.  So I tried creating a countable column, but I
haven't been able to figure out how to combine the three test conditions
into a single counting function or a single function to create a new row of
data I could count like L1.

Here are my 3 formulas, and what I would like the 3rd column to look like if
I can't count the format color changes in J1 directly.
Green  =OR(K2 > Today()+1, AND(K2<>(TODAY()+1),OR(J2 = K2,J2<>0)))
Yellow =AND(K2=TODAY()+1,J2 = 0)
Red =AND(K2<=TODAY(),J2 = 0)

J                                                        K
L
Site inspection                     Site inspection (target)
Compare result
1/12/2007                            1/15/2007
G
3/08/2007                            3/08/2007
G
   0                                        3/10/2007
Y
   0                                        2/28/2007
R
KC Rippstein - 12 Mar 2007 19:21 GMT
I am assuming your data starts in row 2 and could potentially go all the way
to row 100.  You can adjust the 100 up or down, just do it in all 5 places
in all 6 formulas.  You do not need your helper columns J and K if you use
these formulas below.

L2,RED:  =SUMPRODUCT((B2:B100<=TODAY())*(A2:A100=0))
L3,YELLOW: =SUMPRODUCT((B2:B100=TODAY()+1)*(A2:A100=0))
L4,GREEN: =COUNT(A2:A100)-L3-L2

>I have two columns of dates.  The first column is the date the event
> actually occurred or is 0 if nothing has been done yet.  The second column
[quoted text clipped - 38 lines]
>    0                                        2/28/2007
> R
KC Rippstein - 12 Mar 2007 21:55 GMT
Sorry, I have a couple of minor typos below.  For some reason, I thought
your data was in columns A and B and you were trying to figure things out
over in J, K, and L.  Since your actual data is in J and K, use those
instead of A and B.  Very sorry.

Also, when I said to replace the 100 in all 5 places in all 6 formulas, I
meant in all 3 formulas.

What a Monday.

>I am assuming your data starts in row 2 and could potentially go all the
>way to row 100.  You can adjust the 100 up or down, just do it in all 5
[quoted text clipped - 48 lines]
>>    0                                        2/28/2007
>> R
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.