+ Reply to Thread
Results 1 to 10 of 10

Named Range Brings "error" When Using it in a Chart

  1. #1
    Registered User
    Join Date
    06-20-2016
    Location
    Houston
    MS-Off Ver
    2010
    Posts
    73

    Named Range Brings "error" When Using it in a Chart

    I have been wasting hours trying to make this work. I'm lost.

    I have never used Named Ranges till now, and I don't use charts much. But someone on here told me to use them for another issue I was having. So... I made some named ranges with some formulas, and they work. But when I try to use them for the data in some line graph charts, they bring an error... "Excel found a problem with one or more formula references in this worksheet".

    I tried to use -- 'Customer Trend Analysis (Draft 3a).xlsx'!USEDATAG1A -- as my reference for Trend Analysis 1 (first series in the list). For the second series on that chart, it would have been "...USEDATAG1B". Anyway, when I use those named ranges in other ways (such as a data validation list) everything works fine. It is referencing the data as it should. But it won't accept it when I used it in this chart.

    I will upload the chart for you guys to look at. This is an important document for me, and it would be a huge help if someone could solve the problem. I appreciate the help.

    Best Regards,
    - Colby

    UPDATE -- for some reason my computer at work can't attach the file. So I will have to attach it when I get home. If you have any general responses to this question in the mean time, please let me know. Thank you.
    Attached Files Attached Files
    Last edited by nitro22888; 07-07-2022 at 09:03 AM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Named Range Brings "error" When Using it in a Chart

    Hi nitro,

    Are you using a Dynamic Named Range? See: https://docs.microsoft.com/en-us/off...te-chart-range
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    06-20-2016
    Location
    Houston
    MS-Off Ver
    2010
    Posts
    73

    Re: Named Range Brings "error" When Using it in a Chart

    I am not familiar enough to say. Please see the attachment I was finally able to upload this morning. I am using a CHOOSE function (or trying to) to get it to choose between one of three different data sets (on the Chart Data Source sheet). There are 3 sets of 3 rows of data, and each have a number on the far left that changes based on what is selected under the drop-down menus on the first sheet, and those numbers (ranging from 1 to 3) should tell the data in the chart which row of data to pull from.

    You can see each of these formulas named under the names menu, and they are USEDATAG1A, USEDATAG1B, and USEDATAG2.

    I hope that answers your question. I believe that makes this dynamic, but having my little experience with charts at this point, I could be wrong. Please let me know if that helps or not. It would be amazing if I could get this to work.

    Much appreciated, Colby

  4. #4
    Registered User
    Join Date
    06-20-2016
    Location
    Houston
    MS-Off Ver
    2010
    Posts
    73

    Re: Named Range Brings "error" When Using it in a Chart

    I hope my post made some sense. Maybe not?

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Named Range Brings "error" When Using it in a Chart

    Hi Nitro,

    I'm not sure I understand the problem. I'm pretty sure the Choose() function isn't what you want. I'd expect an indirect of a cell that would be the name of the range is what you might want. I don't see that in your example. I'm trying to create a simpler example and failing. I'll toss this up to the smart gurus and see if any of them can get you closer to an answer.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Named Range Brings "error" When Using it in a Chart

    Perhaps this could be a workaround.
    Change the formulas in rows 3:5 on the Graph Data Source sheet to show #N/A if there is no data for a cell, as in:
    For row 3: =IF('Overall Customer Stats 1'!C3<>"",'Overall Customer Stats 1'!C3,NA())
    For row 4 (row 5 is similar):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The axis label range could be set to: ='Graph Data Source'!$C$3:$BB$3
    The series values for customer 1 (customer 2 is similar): ='Graph Data Source'!$C$4:$BB$4
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Named Range Brings "error" When Using it in a Chart

    double post
    Last edited by protonLeah; 07-10-2022 at 02:29 PM.
    Ben Van Johnson

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Named Range Brings "error" When Using it in a Chart

    I changed your range names and dropdown dv list so that the range names correspond to the dv list items without the spaces. E.g.
    range name: AmountQuoted
    refers to: ='AMOUNT QUOTED (CUSTOMER)'!$C$4:$T$209
    on sheet: AMOUNT QUOTED (CUSTOMER)

    the trend 1 graph series are:
    Trend1Series1Data =INDEX(INDIRECT(SUBSTITUTE(Trend1Statistic," ","")),MATCH(Trend1Customer1,CustomerList,0),0)
    Trend1Series2Data =INDEX(INDIRECT(SUBSTITUTE(Trend1Statistic," ","")),MATCH(Trend1Customer2,CustomerList,0),0)

    from the three dv drowns,
    Trend1Customer1 ='Customer Trends'!$C$5
    Trend1Customer2 ='Customer Trends'!$C$6
    and,
    Trend1Statistic ='Customer Trends'!$C$7

    your 'chart data' and 'graph data' sheets are not used.

    Start date & end date determine the number of weeks to display on the graphs.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-20-2016
    Location
    Houston
    MS-Off Ver
    2010
    Posts
    73

    Re: Named Range Brings "error" When Using it in a Chart

    Hey ProtonLeah,

    Wow, you did a ton of work here. Thanks for doing that. I did run into an issue though. The "trend analysis 2" chart ran into an error. It was referencing the "Overall Customer Stats 2" sheet, and something weird was happening on that sheet. It ended up with errors, and without that working properly, you can't have a separate statistic for that chart to compare with the other one.

    I think something in between the two would be perfect. The direction I was going with the workbook I uploaded on this thread was just to match the suggestion by Andy Pope (another Guru on here), and a workbook he linked me to when I was having trouble making the y-axis data change formats (from currency to percentages to whole numbers). He told me to use named ranges to do it, and there was a workbook on the thread he linked me to, which he previously uploaded >> https://www.excelforum.com/excel-cha...er-format.html

    The named range I was trying to use was pretty much identical to his, and his worked. The only difference is his was all contained on the same worksheet, and mine was referencing multiple sheets. I don't know if that's what the problem was, but it's the only thing I could think of.

    I will have to look through all the changes you made so I can understand it, in case I need to update it later. At the moment it's a little daunting. You truly are a 'guru'!

    Having said that, I still need to understand things, and be able to tweak them. Let me know if you have any suggestions. I appreciate your help either way.

    - Colby

  10. #10
    Registered User
    Join Date
    06-20-2016
    Location
    Houston
    MS-Off Ver
    2010
    Posts
    73

    Re: Named Range Brings "error" When Using it in a Chart

    Quote Originally Posted by MarvinP View Post
    Hi Nitro,

    I'm not sure I understand the problem. I'm pretty sure the Choose() function isn't what you want. I'd expect an indirect of a cell that would be the name of the range is what you might want. I don't see that in your example. I'm trying to create a simpler example and failing. I'll toss this up to the smart gurus and see if any of them can get you closer to an answer.
    Hi MarvinP,

    I am using the Choose function to basically copy the method that another Guru (Andy Pope) used in a spreadsheet he linked me to, when I asked for help with my charts. I was struggling to make the y-axis data update the format when the source data changed (from currency to whole numbers to percentages). I need the y-axis to change with the data. The problem he pointed out is that I was using conditional formatting with my source data, and the format will not follow the conditional formatting. What he suggested is having named ranges, and make the source data shift to a different set of cells with the correct formatting whenever I needed the format to change.

    He linked me to this thread, where he posted an excel sheet demonstrating this... https://www.excelforum.com/excel-cha...er-format.html

    He used the choose function to switch between 2 different lists of data, one was a percentage and the other whole numbers. I just copied that.

    The only difference I see is that all of his data, the named ranges, formulas, and chart were on the same worksheet, whereas mine is on multiple sheets. I don't have enough familiarity with charts and named ranges to figure out the problem.

    I am trying to have the data set for "Customer 1" to be the named range/formula "USEDATAG1A" and the data set for "Customer 2" to be "USEDATAG1B". Those formulas/ranges are correct. They bring up the correct data, and update automatically when things are changed. So they should work. But whenever I try to use those named ranges for the data, it tells me there's some error with the formula. I am really confused where that issue is.

+ 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] Define Named Range scope as "Workbook" instead of "Worksheet"
    By Helghan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2020, 12:00 PM
  2. [SOLVED] Copy named range "headerrows" to each worksheet as created by named range "classes"
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-25-2017, 05:23 AM
  3. How to use named ranges in VBA code using "Columns" and a variation on "Range"
    By haljam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2014, 02:48 PM
  4. Getting "..object _worksheet failed..." error with intersect for cell and named range.
    By cool1_boy1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2013, 04:17 PM
  5. Syntax error on trying to create a "Named range"
    By highlystrung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2011, 03:40 PM
  6. Replies: 3
    Last Post: 06-04-2011, 10:56 AM
  7. Link Chart Title to a "named range"
    By finlain in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-30-2010, 10:15 AM

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