SUMIF Help - selecting a specific column from a range of columns

SamWaters

New Member
Joined
Jun 18, 2014
Messages
3
Hi All, I'm struggling with this one - any help would be much appreciated & it's probably really simple.


Firstly, we have a data source which resembles something like:

Col A Col B Col C ... Col M
Product Apr-14 May-14 ... Mar-15
1a
1b
1c
1d
etc

On a separate worksheet used to summarise, we have a drop down selector, whereby you select which month you'd like to view (Apr-14 to Mar-15).

How do I link it so that the summary picks up and sums up the month the drop down (e.g. in cell A1) says.

I've tried a sumif, using a sum range which spans col B to M, and referenced the drop down cell in the criteria, but it didn't work.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try this formula:


=SUM(OFFSET(B1:M1;1;MATCH(H2;B1:M1;0)-1;COUNTA($A$2:$A$5);1))

H2 = dropdown list
A2:A5 = list of products


Do note that there shouldn't be any blanks in the list of the products.
 
Last edited:
Upvote 0
This should be a better one, it doesn't matter if there are blanks:

=SUM(OFFSET(B1:M1;1;MATCH(H2;B1:M1;0)-1;MATCH(REPT("z";99);A4:A5;1);1))
 
Upvote 0
Found a small defect in the formula which adds numbers when there aren't any products linked to it.
Entering the following formula should avoid this problem:

=SUM(IF(A2:A11<>"";OFFSET(A2:A11;0;MATCH(H2;B1:M1;0);MATCH(REPT("z";99);A2:A11);1);0))

enter with ctrl+shift+enter

see below for my used table, answer for apr-14 should be 110 instead of 210.

Productapr-14may-14jun-14
1a1050200
1b1050200
1c1050200
1d1050200
1e1050200
1f1050200
50
50
1g200
1h50200

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,314
Members
449,153
Latest member
JazzSingerNL

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