Month to date sales - reset in new month???

C

citybeing

Hi all,

I have a column that lists daily sales on an ongoing basis. I need to
create a second column which tracks month to date sales (so it will
grow throughout the month). The catch is I need this column to
automatically reset and start counting again when the daily date
becomes a new month. This must be possible, but I can't figure it out.
Any suggestions? Thanks!
 
B

Bob Phillips

=SUMPRODUCT(--(YEAR($A$1:A1)=YEAR(A1), (--(MONTH($A$1:A1)=MONTH(A1),
$B$1:B1)

and just copy down

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

bpeltzer

If your columns are Date (A), Sales (B), and MTD Sales (C), with a header row
1, I'd start in cell C2 with =B2. Then in cell C3, =b3 +
if(month(a3)=month(a2),c2,0). In words, the MTD sales through today are
today's sales, plus the prior day's MTD sales as long as we're still in the
same month. Copy that formula from C3 through the rest of column C.
--Bruce
 
Top