Aggregate Function's Array Argument Gives VOLATILE formula result when using concatenation for Named Range

DR RENO

Board Regular
Joined
Jun 29, 2018
Messages
65
Need experts help on this after racking brain over and over. I have a data sheet, 'DATA', that contains Product and Pricing detail by row. Each row will have a column for Product Name (ie. Product A, Product B, Product C....etc), and a column for Location, (ie.Location 1, Location 2, Location 3....etc.) On another worksheet, I have a table that's a pricing schedule, 'PRICING SCHEDULE', for each product at each location. I've created a Named Range for each Product/Location line on the Pricing Schedule based on the previous product and location name example I gave looks like this: PRODA1, PRODB2, PRODC3. The pricing schedule will have the Price for the Product/Location combo.

The same product can be sold at multiple locations with a different price for each. So it will need a unique name in order to obtain the correct value. I'm using the Aggregate function in order to avoid having a longer formula with multiple IF Statements and And/OR operators. I'm just having trouble with the Aggregate functions array argument.

Aggregate works perfectly if I just directly type in the named range, but unfortunately, I have a dynamic file so I'm needing to reference in each data row the product and location to obtain the correct value from the other sheet. This has me creating a concatenation where I combine LEFT function to get the 1st 4 characters of the Product Name field and RIGHT function for the last character on both the Product Name field and the Location Name field. So for a row where the product is, 'Product B' for location 'Location 4', I get a concatenation of, ProdB4 which I have a named range setup as in the Pricing Schedule. Unfortunately, when I reference the cell that contains the concatenation, it generates a VOLATILE formula result. It also generates a Volatile formula result when entering the concatenation directly into the function's array argument. Here is my formula:

AGGREGATE(15,6,INDIRECT(CONCATENATE(LEFT(B2,4)&RIGHT(B2,1)&RIGHT(H2,1))/(CONCATENATE(LEFT(B2,4)&RIGHT(B2,1)&RIGHT(H2,1)))>$P2),1)


If I just type in PRODB4 where I am referencing my named range, the formula works perfectly, as the formula result give me a value. Again, I know there might be another formula option, but I don't want to get into a long IF statement, so would really need to keep using AGGREGATE. I am open to renaming the Named Ranges if you have a better suggestion, as well as obviously any formula changes you recommend.

Any help you can give with this will be greatly appreciated


 
That's not working for me. Values are not coming in as expected

[TABLE="width: 490"]
<colgroup><col span="5"></colgroup><tbody>[TR]
[TD]Proposed Year 1[/TD]
[TD]Proposed Year 2[/TD]
[TD]Proposed Year 3[/TD]
[TD]Proposed Year 4[/TD]
[TD]Proposed Year 5[/TD]
[/TR]
[TR]
[TD]7.05[/TD]
[TD]29.00[/TD]
[TD]7.05[/TD]
[TD]10,993.32[/TD]
[TD]21.48[/TD]
[/TR]
[TR]
[TD]7.29[/TD]
[TD]29.00[/TD]
[TD]7.29[/TD]
[TD]10,993.32[/TD]
[TD]29.80[/TD]
[/TR]
[TR]
[TD]5.35[/TD]
[TD]29.00[/TD]
[TD]5.00[/TD]
[TD]12,184.64[/TD]
[TD]27.77[/TD]
[/TR]
[TR]
[TD]8.00[/TD]
[TD]29.00[/TD]
[TD]8.00[/TD]
[TD]13,059.28[/TD]
[TD]44.85[/TD]
[/TR]
[TR]
[TD]7.29[/TD]
[TD]29.00[/TD]
[TD]7.29[/TD]
[TD]10,993.32[/TD]
[TD]42.28[/TD]
[/TR]
[TR]
[TD]8.66[/TD]
[TD]29.00[/TD]
[TD]8.66[/TD]
[TD]13,059.28[/TD]
[TD]65.75[/TD]
[/TR]
[TR]
[TD]62,000.00[/TD]
[TD]38.00[/TD]
[TD]7.29[/TD]
[TD]62,000.00[/TD]
[TD]45.11[/TD]
[/TR]
</tbody>[/TABLE]


Here's a link to file I used.

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]https://www.dropbox.com/s/2ub7fa1hwi8vjqy/PROD%20DATA_EXCELHELP_10Jun2019V2.xlsx?dl=0[/FONT]
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Dr Reno,

Your file use different columns and ranges.
Please, try to use the correct columns and adjust the data ranges!

Your formula in Q2 should be
=IFERROR(AGGREGATE(15,6,'Price Schedules'!$B$2:$K$28/(('Price Schedules'!$A2:$A28=$B2)*('Price Schedules'!$L$2:$L$28=$H2)*('Price Schedules'!$B$2:$K$28>P2)),1),P2)

Worked perfectly for me!

M.
 
Last edited:
Upvote 0
oops..correction (missed the $ in 'Price Schedules'!$A$2:$A$28=$B2)

Your formula in Q2 should be
=IFERROR(AGGREGATE(15,6,'Price Schedules'!$B$2:$K$28/(('Price Schedules'!$A$2:$A$28=$B2)*('Price Schedules'!$L$2:$L$28=$H2)*('Price Schedules'!$B$2:$K$28>P2)),1),P2)

M.
 
Last edited:
Upvote 0
Marcelo

Awesome job!!!. Gives me exactly the results I was looking for. Really appreciate you working with me to get this solved. All the best!

Dr. Reno
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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