Solved

SUMIFS using Column and Row Criteria

Posted on 2013-06-10
4
517 Views
Last Modified: 2013-06-10
I am attaching a spreadsheet that is tracking the affects of a cost reduction plan that has been put into place.  I shows the actual cost by site and the average cost and date the cost reduction plan was implemented by site.  I have it working using specific cells however I am talking about a number of spreadsheets that have anywhere from 2 sites to 30 and I was hoping to find a formula that would easier to maintain.  Any help with what I am doing wrong with my SUMIFS formula I would appreciate.
Cost-Reduction.xlsx
0
Comment
Question by:kscott61
4 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 39235677
In B31, enter this formula...

=IF($A31>VLOOKUP(B$30,$A$17:$B$21,2,FALSE),VLOOKUP(B$30,$A$17:$C$21,3,FALSE)-INDEX($A$1:$E$14,MATCH($A31,$A$1:$A$14,0),MATCH(B$30,$A$1:$E$1,0)),0)

Copy that down and across to B31:E43
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 39235688
SUMIFS requires all ranges to be the same size so the SUMIFS that references the top table will always return an error.

I'm not sure if your real data will be the same but in your example shown here all of the functions are picking up single values so it might be more appropriate to use VLOOKUP type formulas to do that, e.g. in B31 copied across and down this formula will give you the same result as shown in your results table

=IF($A31>VLOOKUP(B$30,$A$18:$B$21,2,0),VLOOKUP(B$30,$A$18:$C$21,3,0)-INDEX($B$2:$E$14,MATCH($A31,$A$2:$A$14,0),MATCH(B$30,$B$1:$E$1,0)),0)

Note: if sites or dates are in the same order in the result table as the data you may be able to simplify that

regards, barry

Edit: I see Patrick beat me to it.......Snap!
0
 
LVL 23

Expert Comment

by:NBVC
ID: 39235732
How about?

=IF(SUMIFS($C$18:$C$21,$A$18:$A$21,B$30,$B$18:$B$21,"<"&$A31)=0,0,IFERROR(SUMIFS($C$18:$C$21,$A$18:$A$21,B$30,$B$18:$B$21,"<"&$A31)-SUMIFS(INDEX($B$2:$E$14,0,MATCH(B$30,$B$1:$E$1,0)),$A$2:$A$14,$A31),0))

copied down and across.
0
 

Author Closing Comment

by:kscott61
ID: 39236250
Thank you very much and you were a winner by a few minutes, but the formula worked perfectly.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question