Can I use index as my range in a formula.

helpneeded2

Board Regular
Joined
Jun 25, 2021
Messages
110
Office Version
  1. 365
Platform
  1. Windows
I have 20 columns (AU:BV) in my spreadsheet. These columns contain a number of transactions for a client, and the header contains the name of a location. There are about 150,000 rows of clients.

In a separate sheet, I have a list of the location names. For each location, I want a column that will total all the client transactions at that location, if they client meets certain conditions (i.e.: the value in column AM = "Yes", and the value in AO = "H" or "P".

I am not very experienced at Excel, so I just can't figure out a way to do this.

I believe it would require a sumif, such as =sumif(range,AM:AM,"Yes",AO,{"H","P"}) ?

However since the range (the column to be summed) is going to differ between location names, I don't know how to link the 2 together, aside from making a 2 column table for the location names, and then a text value for the range ("AU"), and then lookup that value and make that the range via an indirect statement -- but I'm sure there is a better way?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
You could use something like

=sum(sumif(index(AU:BV,0,match(location,AU1:BV1,0)),AM:AM,"Yes",AO:AO,{"H","P"}))
 
Upvote 0
You could use something like

=sum(sumif(index(AU:BV,0,match(location,AU1:BV1,0)),AM:AM,"Yes",AO:AO,{"H","P"}))
That works perfectly (after changing the sumif to a sumifs).

Thank you greatly for your time in replying, and for being able to decipher my narrative of the issue.
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

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