Adding Days
If your dates are true Excel dates then:
=SUMIF(A2:A200,"Monday",B2:B200)
Won't work!
Try this array formula** :
=AVERAGE(IF(WEEKDAY(A2:A200,2)=n,B2:B200))
Where n is the number of the weekday of interest:
Monday = 1
Tuesday = 2
Wednesday = 3
...
Sunday = 7
n can be a cell reference that holds the weekday number:
D2 = 1 (for Monday)
=AVERAGE(IF(WEEKDAY(A2:A200,2)=D2,B2:B200))
** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.
--
Biff
Microsoft Excel MVP
"Toast" wrote in message
...
Column A has dates, and column B has sales figures for the respective
dates.
I'm trying to use =SUMIF to add together all the "Mondays" and the rest of
the days of the week, and =COUNTIF to count the number of "Mondays" so
that I
can get a value that tells me how much each day's average is
approximately.
I've gotten this far, then got stuck because I have no idea what to do:
=SUMIF(A2:A200,"Monday",B2:B200)
Your help's appreciated ahead of time :)
|