Selecting a Specific Column of a Named Range for the SUMIF Function

Cla Rosie picture Cla Rosie · Nov 24, 2016 · Viewed 27.2k times · Source

I am trying to create a SUMIF function that dynamically adds up values in a specific column of a named range in my Excel sheet.

It is very easy to do this when there is no named range :

enter image description here

The formula picks out all the cells that contain "London" in their name and sums up the expenses related to London.

What I am trying to do is to use a named range called TripsData (A2:B5) and tell the SUMIF function to sum the entries in the column 2 of this range that meet the criterion of having London in their name.

How can I make this work without needing to create a second named range for column 2 and simply by telling Excel to look within the specified column of this named range? Index/Match only return one value so that doesn't work when there are several cells with London in their name.

Thanks for your help!

Answer

chris neilsen picture chris neilsen · Nov 24, 2016

Use INDEX to refer to a specific column in the named range (it can refer to a whole column), like this

=SUMIF(TripsData,"*London*",INDEX(TripsData,,2))