Sumproduct with Multiple Rows and Columns

jdavid1006

New Member
Joined
Oct 21, 2019
Messages
6
Hi guys,

Although I've been reading for a number of years, this is my first post. Please bear with me if I do something incorrectly.

I have a workbook that is basically taking invoices and rolling them up by date, truck number, and expense type. The problem is there can be multiple invoices in a month. I think I need to use the sumproduct formula but I'm not super familiar with it.

I have a summary that looks like the table below but I need to see everything by month and YTD. I can still have the Truck and Type columns (brakes, tires, etc...). Any ideas on what I can do? Thank you!

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]Invoice 123[/TD]
[TD]Invoice 456[/TD]
[TD]Invoice 789[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]August[/TD]
[TD]August[/TD]
[TD]September[/TD]
[/TR]
[TR]
[TD]Truck 1[/TD]
[TD]Brakes[/TD]
[TD]50[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Truck 2[/TD]
[TD]Tires[/TD]
[TD][/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Truck 2[/TD]
[TD]Maintenance[/TD]
[TD]25[/TD]
[TD]25[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]Truck 3[/TD]
[TD]Brakes[/TD]
[TD][/TD]
[TD][/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]Truck 4[/TD]
[TD]Maintenance[/TD]
[TD][/TD]
[TD]25[/TD]
[TD]25[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I need my final result to look like this:


[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]August[/TD]
[TD]YTD[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Truck 1[/TD]
[TD]Brakes[/TD]
[TD]50[/TD]
[TD]150[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Truck 1[/TD]
[TD]Maintenance[/TD]
[TD]25[/TD]
[TD]200[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Truck 1[/TD]
[TD]Tires[/TD]
[TD]100[/TD]
[TD]100[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Truck 2[/TD]
[TD]Brakes[/TD]
[TD]0[/TD]
[TD]200[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Truck 2[/TD]
[TD]Maintenance[/TD]
[TD]25[/TD]
[TD]200[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Truck 2[/TD]
[TD]Tires[/TD]
[TD]0[/TD]
[TD]200[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


And so on...
 
Upvote 0
Good idea but I need to compare it to a budget file. The pivot table can be referenced but it's not very pretty and this will be seen by senior leadership. I'd like to use formulas, if I can.
 
Upvote 0
Welcome to the MrExcel board!

See if this helps. Each formula copied down.

Excel Workbook
ABCDE
1Invoice 123Invoice 456Invoice 789
2AugustAugustSeptember
3Truck 1Brakes50
4Truck 2Tires100
5Truck 2Maintenance252525
6Truck 3Brakes50
7Truck 4Maintenance2525
8
9
10AugustYTD
11Truck 1Brakes5050
12Truck 1Maintenance00
13Truck 1Tires00
14Truck 2Brakes00
15Truck 2Maintenance5075
16Truck 2Tires100100
Summary
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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