+ Reply to Thread
Results 1 to 18 of 18

Reference To Named Range Causing Volatile Aggregate Forumula

  1. #1
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Reference To Named Range Causing Volatile Aggregate Forumula

    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 product name, Product A, Product B, Product C....etc, and location name, 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.

    A product can be sold at multiple locations with a different price for each. I'm needing to find the minimum price on the associated Pricing Schedule for each line item on DATA sheet, based on the last Transacted Price listed in each row item on DATA sheet. Here's my issue:

    I'm using Aggregate formula that works perfectly if I just directly type in the named range, but unfortunately, I have a dynamic file so I'm referencing the product and location to find the correct value in the other sheet. This has me creating a concatenation where I combine LEFT function to get the 1st 4 characters of Product Name field and RIGHT function for last character on both the Product Name field and the Location Name field. So for a row where 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. Unfortuntatly when I reference the cell that contains the concatenation, it generates a VOLATILE formula. Here is my forumula:

    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 perfect. 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. Open to renaming Named Ranges if you have better sugestion, as well as obvisouly any formula changes you recommend.

    Thank you for your help on this.

  2. #2
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    Just one clarification to avoid any confusion. Prior to writing the post, I had indeed had the concatentation in another cell on the applicable row in DATA sheet. I had been using an INDIRECT function and then referencing the cell with the concatenation. However, when typing out my message to you, I thought about just attempting to do the concatenation inside the AGGREGATE formula along with INDIRECT function. Neither method works for me, as it shows a VOLATILE reading. Again if I actually type the NAMED RANGE in the AGGREGATE formula, it gives me the expected value. Sorry for any confusion this may have provided.
    Last edited by AliGW; 06-10-2019 at 03:52 AM. Reason: Please don't quote unnecessarily!

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    one more clarification to avoid any confusion
    please upload a small example

  4. #4
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    Here is an example. Please note the spreadsheet 'Position'= 'Product' in post write-up.
    Attached Files Attached Files

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    Hi,

    Not sure I understand what you are getting at, to be perfectly honest. INDIRECT is well known to be volatile; why the assertion that referencing a Named Range is causing the volatility?

    Or do you have a different definition of 'volatility' in mind?

    Regards
    Last edited by XOR LX; 06-09-2019 at 03:09 PM.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  6. #6
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    I don't disagree. If you replace the Indirect/Concatentation in highlighted cell with the actual named range. The formula works. I need that to be done for each row down. I tried INDIRECT since the named ranges were on another sheet, thinking that might be the issue. It's not though.
    Last edited by AliGW; 06-10-2019 at 03:51 AM. Reason: Please don't quote unnecessarily!

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    So what's the issue? What do you mean by 'volatility' here?

    Perhaps re-post your workbook with an instance of the formula which doesn't work.

    Regards

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    I don't understand what you want but this would get you the same result as W2

    =AGGREGATE(15,6,PaySched/(PaySched[Position]=B2)/(PaySched[Location]=H2)/(PaySched>P2),1)

  9. #9
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    Nailed it BO_Ry. I really appreciate your help with this.
    Last edited by AliGW; 06-10-2019 at 03:51 AM. Reason: Please don't quote unnecessarily!

  10. #10
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    After further review, Bo's solution does not work. Using the table fields will not work for this problem, as the same Product/Position is found in multiple locations and does not keep the same pricing. That is why I created name ranges for each Product/Position and it's applicable location. Sorry for the confusion. Bo's solution does remove the Volatile reading in Aggregate and displays each instance of the array. So on right track, but I just need to do the same with the named ranges.

    Sorry for thinking the solution was solved and creating additional confusion.
    Last edited by AliGW; 06-10-2019 at 03:51 AM. Reason: Please don't quote unnecessarily!

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    I think your whole approach probably needs reworking here. Sometimes it's better to let the experts on this forum work on their own solution to the problem, rather than pressing them for your own (rather convoluted, I'm afraid to say) solution to be modified.

    With that in mind, might I suggest that you ditch any further conversations re your attempted Named Range solution and instead re-post a workbook with expected results filled in in column W? Importantly, I would also recommend doing this for some entries in the Location Facility column which are different from Location 1.

    Regards

  12. #12
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    I appreciate the response, but I don't believe I'm asking for a "convoluted solution". I'm trying to obtain/create a named range from two different cells in a data row. Production A and Location 1, for example, will be ProdA1. When I type 'ProdA1' directly into the Aggregate function you can see the function arguments are correct, as the formula result is giving an actual value and not 'Volatile'. Bo_Ry's solution was close, as his did give a value. However it's doing a lookup on the 1st matching position in the table field. I have the same product in multiple locations with a different associated price, which is why my named range and concatenation is using both the location and product/position. In my opinion, a convoluted solution would be one where I simplify my formula by using If statements with And/Or operators. The result would be 3 additional lines.

    I don't feel an additional workbook is needed for this solution. In essence there has already been more data than necessary. My highlighted field with the Aggregation function needs the array to reference product and location in the form of a table field or named range. I'm open to another naming convention for named range if it makes utilizing those two columns easier. I just need to create a unique name that is recognized and accepted in a function argument.
    Last edited by AliGW; 06-10-2019 at 03:50 AM. Reason: Please don't quote unnecessarily!

  13. #13
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    Anyone? Essentially all I'm trying to do is replace the named range for the array in this formula, =IF(D2>=OFFSET(INDEX(PaySchedule,MATCH(CONCATENATE($A$1,"",$A2),'Salary Schedules'!$A$1:$A$16,0),12),1,0),D2,AGGREGATE(15,6,INDIRECT("Posi"&$A2)/(INDIRECT("Posi"&$A2)>D2),1)). My new data has location facility needed in addition to position, so I had to change my named range. It also has both full-time positions and part-time positions, so I had to add IF Statement to account for that since rate and salary are in different cells on my data sheet.

    =IF(AND($D2>=$P$2)*OR($B2="POSITION A",$B2="POSITION W"),$D2,IF(OR($B2="POSITION A",$B2="POSITION W"),AGGREGATE(15,6,INDIRECT("POSI"&$U2))/(INDIRECT("POSI"&$U2))>$P2),1),IF(E2>P2,E2,AGGREGATE(15,6,INDIRECT("POSI"&$U2))/(INDIRECT("POSI"&$U2))>$P2),1)))

    I'm getting an error saying too many arguments. I think it's the closing parenthesis for the AGGREGATE function array, but not sure why or how to get around this. Any help you can give is really needed and appreciated.

  14. #14
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    It's a shame that you see it that way, since there may well exist a solution which is entirely different to - and much simpler than - that which you are currently insisting upon implementing.

    However, if you're not prepared to do as as I ask then could you at least respond to my earlier questions? That is:

    What do you mean by 'volatility' here, assuming you have some definition different to the conventional one? INDIRECT - a volatile function - is the only way to create references to Named Ranges via dynamic concatenation of text strings. Nevertheless, it works, despite said volatility. Given that you seem insistent on going down this route, wouldn't a volatile - yet working - workbook be an acceptable solution?

    Secondly, can you give an instance of the formula in your original workbook which does not give the results you would expect? You only give one, in cell W2, which seems to produce a correct result - copying this formula down also gives the results I would expect, i.e. 7.2915 for Position A/Location 1 and a #NUM! error for Position W/Location 1 (unfortunately, these are the only two combinations you give for testing).

    Regards

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    Administrative Note:

    RenoMartinez - please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

  17. #17
    Registered User
    Join Date
    09-29-2012
    Location
    Houston, Texas
    MS-Off Ver
    MS Office 2016
    Posts
    43

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    Understood Ali and I do apologize if you or others feel that I violated policy as that was not my intention. I've utilized this site several times in the past in both the general help forum and commercial services and have been both impressed and satisfied with the help I've received. Unfortunately this thread didn't receive the traction that as I hoping based on past experiences. I don't mean that as anything negative on anyone who responded, as it very well was the result of how I wrote my post. I will not go into any of the why's for cross-posting, but will just say that it won't happen again.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Reference To Named Range Causing Volatile Aggregate Forumula

    However, you do need to provide the links requested, please. Thank you.

    if you or others feel that I violated policy as that was not my intention
    Nonetheless, rule #3 is pretty clear:

    https://www.excelforum.com/forum-rul...rum-rules.html

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] What part of code is causing a new named range?
    By HalPlz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2015, 10:14 PM
  2. Replies: 1
    Last Post: 07-29-2015, 02:32 PM
  3. Non-Volatile Alternative: Cell or Indirect and Address for Named Range Formula
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2015, 10:02 AM
  4. Volatile Functions causing issues
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-21-2014, 10:40 AM
  5. [SOLVED] Issue w/dynamic named range causing Excel to crash
    By plasmas222 in forum Excel General
    Replies: 10
    Last Post: 03-07-2014, 08:18 PM
  6. Does this solution for non volatile dynamic named range work?
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-22-2012, 01:53 AM
  7. Named range causing really weird problems - HELP
    By Abbas in forum Excel General
    Replies: 0
    Last Post: 07-26-2006, 01:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1