Is there a way of condensing this Formula(Sumifs,Indirect,Match)?

Coyotex3

Well-known Member
Joined
Dec 12, 2021
Messages
507
Office Version
  1. 365
Platform
  1. Windows
This formula works as intended but I'm looking for ways to make the formula's shorter and easier to understand if possible. Are there any shorter alternatives to this formula?


VBA Code:
=IFERROR(SUMIF(INDIRECT("'[Source1.xlsx]"&$B$1&"'!C"&MATCH("Person",INDIRECT("'[Source1.xlsx]"&$B$1&"'!2:2",TRUE),0),FALSE),A3,INDIRECT("'[Source1.xlsx]"&$B$1&"'!C"&MATCH("Total per Person",INDIRECT("'[Source1.xlsx]"&$B$1&"'!2:2",TRUE),0),FALSE)),0)*N3
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hey Coyote - more context about your data sets might be helpful.

It's a strange formula for sure - it looks like the MATCH portion of the formulas are looking up words ("Person" or "Total per Person" within a row (2:2, specifically), which means the value being returned is actually a number for a column.

However, the results of that MATCH formula are being placed in as a row reference (ex. ...!C"&MATCH... results in something like ...!C3 being the reference).

So the fact that the match lookup is finding a column value and filling it as a row reference kinda suggests the whole formula is a bit overkill - it looks like your just doing a single cell lookup and probably should just be using an INDEX formula instead?

But maybe it would all make more sense with a couple of screenshots or description of the tables your formula are referencing.
 
Upvote 0
I think the original intent of this formula was to lookup "Person" within the column headers, in a different workbook and then return a value. I just came across this formula and I've had a hard time deciphering it. I will try to see if I can provide an example.

Thank you.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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