SUBTOTAL with values returned by INDEX

Yamezz

Active Member
Joined
Nov 22, 2006
Messages
336
Office Version
  1. 2019
I have a sheet with dates in column A and prices in column O.
Cell O1 contains the formula =SUBTOTAL(9,O3:O100000).
Prices in column O are returned from the product of column N and an INDEX formula.
The INDEX formula computes correctly, but the SUBTOTAL formula fails to include prices derived from the INDEX formula.
Cell formats are set to currency and adding =VALUE() to the index formula does not help.
If I overwrite the prices returned by INDEX with the actual value then SUBTOTAL(9, begins to work.

How can I get SUBTOTAL(9, to work correctly with the INDEX results?

Thanks.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
What is driving the INDEX function, in order to return the row? You will need to force INDEX to return a reference and not a Value. For example, using O3:INDEX(O3:100000,15), will return O3:O18. This will the allow the Subtotal to calculate.
 
Upvote 0
Here's an example of the formula in O11069. Column L holds the type of product and column N holds the amount of that product to arrive at a total price (derived from the InputCosts table), which in this case is displayed in O11069 correctly as $5.00

=N11069*(INDEX(InputCosts[Cost],AGGREGATE(15,6,(ROW(InputCosts[Cost])-ROW(InputCosts[#Headers]))/((InputCosts[Item]=L11069)*(InputCosts[Date]=AGGREGATE(14,6,InputCosts[Date]/((InputCosts[Item]=L11069)*(InputCosts[Date]<=A11069)),1))),1)))

I'll admit, I don't fully understand the formula above, as it was adapted from something I found online posted by someone far smarter than me!
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

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