Nested SumIF - variable sumrange

Conchubhair

New Member
Joined
Mar 2, 2011
Messages
2
I want to use a fairly basic sumif formula:

The range is defined: Col A ("Political Party Name")

The criteria is defined ("The header of Column F - a political party")

However the sumrange needs to vary with the data in column B, which contains a list of column numbers.

EG

Cols C, D, E contain vote numbers relating to different counts, and the number in Col B indicates which Column to sum if the criteria are satisfied.


Can't get it to work - does Excel permit nested formulae in SUMIF - presume it doesn't if I have to use an array for multivariate sumifs? Tried bastardising using combinations of LEFT(ADDRESS(),2), but that only returns the col letter, rather than the column range, and if I concatenate it with a "Col letter"&":"&"col letter", it returns a text string rather than a range reference which Excel recognises.

Proposals for any array, or simpler workarounds greatfully recd!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,

Have you tried playing around with the offset function?

i.e. =SUMIF(A:A,L1,OFFSET(B:B,0,B2-1))

With L1 being your criteria and B2 containing the column number of the data you want to sum.

Jon
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,876
Members
452,949
Latest member
Dupuhini

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