Sumif Array with horizontal and vertical criteria

rpm567

New Member
Joined
Jun 29, 2016
Messages
9
Account CodeJanFebMar%Fixed%Variable
6X$100,000$50,000$25,000100%0%
5X$200,000$250,000$50,00025%75%
4X$150,000$100,000$050%50%

<tbody>
</tbody>

I have sheets relating to various cost centers and each line is the spend for a specific account. Let's call the above table as sheet1 and the summary table below, as sheet2. The summary table is like:

Cost CenterFixed/VariableJanFebMar
100Fixed???
100Variable???

<tbody>
</tbody>

I can't figure out the formula to fill in the cells. I have too many to do everything manually, any help would be greatly appreciated!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

StephenCrump

MrExcel MVP
Joined
Sep 18, 2013
Messages
5,111
Office Version
  1. 365
Platform
  1. Windows
You haven't told us what results you're expecting?

I'm guessing that the top left "?" should be $225,000, i.e. (100% of $100,000) plus (25% of $200,000) plus (50% of $150,000)?

But how do we know that Account codes 6X, 5X and 4X belong to cost centre 100?
 
Upvote 0

rpm567

New Member
Joined
Jun 29, 2016
Messages
9
You haven't told us what results you're expecting?

I'm guessing that the top left "?" should be $225,000, i.e. (100% of $100,000) plus (25% of $200,000) plus (50% of $150,000)?

But how do we know that Account codes 6X, 5X and 4X belong to cost centre 100?

Okay, sorry for being vague... let me try to frame this more appropriately.

Sheet1:

JanFebMarState%Fixed%Variable
100500200NY50%50%
10002000500CA100%0%
2000600400CA0%100%
8001200500NY75%25%

<tbody>
</tbody>

Sheet2:
StateFixed/Variable CostsJanFebMar
NY Fixed6501150475
NY Variable250550225
CAFixed10002000500
CAVariable2200900525

<tbody>
</tbody>

I'm looking for a formula to produce the values in red.
Thanks again for taking the time to help!
 
Upvote 0

Tetra201

MrExcel MVP
Joined
Oct 14, 2016
Messages
3,801
Here is the formula for cell C2 on Sheet2. It must be entered using Ctrl+Shift+Enter, not just Enter. Then it can be copied down and across.

=SUM(IF(Sheet1!$D$2:$D$5=$A2,INDEX(Sheet1!$A$2:$C$5,0,MATCH(C$1,Sheet1!$A$1:$C$1,0)))*IF(Sheet1!$D$2:$D$5=$A2,INDEX(Sheet1!$E$2:$F$5,0,MATCH("*"&$B2,Sheet1!$E$1:$F$1,0))))

Note: to the best of my understanding, you've miscalculated CA Variable.
 
Upvote 0

Forum statistics

Threads
1,190,919
Messages
5,983,588
Members
439,852
Latest member
balasat

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
Top