OFFSET,COUNT formula for current month?

Big Lar

Well-known Member
Joined
May 19, 2002
Messages
557
Sheet1 is a datasheet with Column Headers in Row1 and values in Columns A2:AG<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
Column A is Date mm/dd/yy
<o:p> </o:p>
<o:p> </o:p>
This formula in Sheet2 provides the last row values in a report (“Today’s Totals)<o:p></o:p>
=OFFSET(Sheet1!T1,COUNT(Sheet1!T:T),0)+OFFSET(Sheet1!U1,COUNT(Sheet1!U:U),0)/4<o:p></o:p>
<o:p> </o:p>
This formula in Sheet2 provides the column totals in a report (“Year to Date”)<o:p></o:p>
=SUM(Sheet1!T:T)+SUM(Sheet1!U:U)/4<o:p></o:p>
<o:p> </o:p>
Is there a formula that will return the SUM of column values for the current month for a “Month to Date” report?<o:p></o:p>
i.e. If the last value in Column A is 05/21/11, COUNT(Sheet1!T:T) for May dates only?<o:p></o:p>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Rather than OFFSET(), I'd go with INDEX().

Today's total formulas would be:
=INDEX(T:T,COUNT(T:T))
=INDEX(U:U,COUNT(U:U))/4

I'd put the latest entry date in a cell somewhere (I put it in Y1):
=INDEX(A:A,COUNT(A:A))

Then you can use a variation of the following to provide May totals (latest entry month):
=SUMIFS(T:T,$A:$A,">="&EOMONTH($Y$1,-1)+1,$A:$A,"<=" & $Y$1)
=SUMIFS(U:U,$A:$A,">="&EOMONTH($Y$1,-1)+1,$A:$A,"<=" & $Y$1)/4
 
Upvote 0
Scott,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
Thanks for your advice and suggestions. However,<o:p></o:p>
<o:p></o:p>
=INDEX(T:T,COUNT(T:T)) returns the next to last row of data. Deleting the worksheet’s header row resolves this issue…but I really need the header row.<o:p></o:p>
<o:p></o:p>
I put =INDEX(A:A,COUNT(A:A)) in cell AL1 and<o:p></o:p>
<o:p></o:p>
=SUMIFS(T:T,$A:$A,">="&EOMONTH($<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:State w:st="on">AL</st1:State>$1,-1)+1,$A:$A,"<=" & $<st1:State w:st="on"><st1:place w:st="on">AL</st1:place></st1:State>$1) in cell AM1<o:p></o:p>
<o:p></o:p>
Result equals #NAME?<o:p></o:p>
<o:p></o:p>
I changed the format of Column A and cell AL1 from Date “mm/dd/yy” to General…no change in the result.<o:p></o:p>
<o:p></o:p>
Any suggestions?<o:p></o:p>
 
Upvote 0
SUMIFS is available with Excel 2007 and later. Are you using an earlier version?
 
Upvote 0
Put this in AM1:
=SUMIF($A:$A,">=" & DATE(YEAR($AL$1),MONTH($AL$1),1),T:T)
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,683
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top