Formula for month and year-to-date data

jyroxxor

New Member
Joined
Feb 26, 2018
Messages
11
Excel 2013/2016
ABCDEFGH
1Trial Balance
2
3Jan18Feb18Mar18MonthFeb18
4$$$
5Sales1006001100MonthYear-To-Date
6Sales2007001200$$
7Purchase3008001300Sales23003100
8Purchase4009001400
9Sales50010001500MonthMar18
10
11MonthYear-To-Date
12$$
13Sales38006900

<tbody>
</tbody>
Sheet1



Hi all,

Would like to check on formula for G7 & H7.

Cell F3 is drop down menu which for me to select data for particular month.

For example, if I select Month = Mar18.
Cell G7 (monthly data) would reflect sales for Mar18, which is $3800
Cell H7 (year-to-date data) would reflect total sales from Jan18 to Mar18, which is $6900
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Is sales data only up to row 9?
 
Upvote 0
If every column has different row number, it'd be no so easy to write a formula to fit all scenarios.

Try this formula for monthly total:

=SUMIFS(INDIRECT(ADDRESS(4,MATCH(F3,A3:E3,0))&":"&ADDRESS(9,MATCH(F3,A3:E3,0))),A4:A9,"=Sales")
 
Upvote 0
Hi,

Try this : Ctrl+Shift+Enter NOT just Enter

G7 =SUMPRODUCT(SUMIF(A5:A9,"sales",INDEX(B5:D9,0,MATCH(G3,B3:D3,0))))
H7 =SUM(B5:INDEX(B5:D9,ROWS(A5:A9),SUM(--(MONTH(DATEVALUE(LEFT(G3,3)&" 1"))>=MONTH(DATEVALUE(LEFT(B3:D3,3)&" 1")))))*--(A5:A9="Sales"))



ABCDEFGH
1Trial Balance
2
3Jan18Feb18Mar18MonthMar18
4$$$
5Sales1006001100MonthYear-To-Date
6Sales2007001200$$
7Purchase3008001300Sales38006900
8Purchase4009001400
9Sales50010001500

<colgroup><col width="70" span="9" style="width:52pt"> </colgroup><tbody>
</tbody>
 
  • Like
Reactions: yky
Upvote 0

Forum statistics

Threads
1,214,815
Messages
6,121,715
Members
449,049
Latest member
THMarana

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