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

Proposed Year 1Proposed Year 2Proposed Year 3Proposed Year 4Proposed Year 5
7.0529.007.0510,993.3221.48
7.2929.007.2910,993.3229.80
5.3529.005.0012,184.6427.77
8.0029.008.0013,059.2844.85
7.2929.007.2910,993.3242.28
8.6629.008.6613,059.2865.75
62,000.0038.007.2962,000.0045.11

<colgroup><col span="5"></colgroup><tbody>
</tbody>


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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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,214,606
Messages
6,120,487
Members
448,967
Latest member
visheshkotha

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