+ Reply to Thread
Results 1 to 5 of 5

Referencing values of user defined value outside of a table

  1. #1
    Registered User
    Join Date
    05-29-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    2

    Referencing values of user defined value outside of a table

    Hi there,

    I've tried to give an example of the problem in the attached image.

    Capture.JPG

    Intro
    I have a table - the grey cells make up the header row.
    It contains some data (columns 1-4)
    To the right of this I'm showing Values depending on certain criteria (Columns S32, S33, S34)
    The variable X is a user-defined within Name Manager - lets call the formula "Result"

    The problem
    In the totals regiion, I want to say:
    =sumifs(Result,Table1[S32],(some criteria))

    The value of Result is different in each cell.

    I get a #Value error on "Result".
    Essentially excel doesn't recognise I only want the sum of "Result" from each single column.

    I've also tried SUMPRODUCT to the same effect.

    The Question
    How do I reference a user defined value within a specific range?
    I want to be able to say something like:
    (Table1[S32].Result)
    But this doesn't work.

    Any help much appreciated.
    Last edited by tombomb; 02-03-2016 at 01:51 PM.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Referencing values of user defined value outside of a table

    I am unsure of how your spreadsheet is truly organized. If this goes much further, then please attach a sample worksheet which includes the result you desire (even if it is hand calculated).

    My understanding is that you have a formula defined in the name manager called Result. I don't know if X is what you really have on your spreadsheet or if is a number. You call it a variable, so I'll assume it is a calculated number in each of the cells in the S-columns, since you can't sum an 'X'. And, I'll assume that X is generally a different value in each of those columns.

    When you use SUMIFS, the first value needs to be a range. It does not sound like Result is a range, but is a value. I don't see why this would not work for you:
    =sumifs(Table1[S32],Table1[S32],criteria...)
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Registered User
    Join Date
    05-29-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    2

    Re: Referencing values of user defined value outside of a table

    Hi Pauley,

    You're absolutely correct with your assumptions and your understanding of my sheet.
    The mistake was mine in not fully defining the problem.

    As you rightly say, X isdifferent in each cell and is the result of the "Result" formula.

    The problem is that X is not the only thing present in the S32-34 columns. The contents of those cells are actually a concatenation of a number of results to different formulae. So in my original definition i should have said that the cells in columns S32-43 actually read: "=result&" / "&anotherformula1&" / "&anotherformula2.

    Therefore I can't simply sum the contents of those columns...

    Any thoughs?

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,476

    Re: Referencing values of user defined value outside of a table

    This is why I don't like to concatenate "result" with other text strings in a single cell. This would probably be easy if you had kept "result" separate from the other parts of the final text string.

    Assuming the final text strings in S32:S34 are essential to the spreadsheet, I would put "result" in a helper column. This helper column is then the =result alone, and your formulas that need to "sum" results can simply refer to this helper column. Columns S32 can be =helper column & another formula & another formula. This strategy keeps the information in result by itself where it is more easily accesible to other functions.

    If you are desperately opposed to using a helper column, then you will need to use Excel's text functions (LEFT(), MID(), etc) to "undo" the concatenation in S32:S34 inside of your "sum" function. https://support.office.com/en-us/art...__toc309306717 IMO, it is much easier to use a helper column.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Referencing values of user defined value outside of a table

    I concur with Mr. Shorty. There is no shame in having a hidden helper column, especially if it makes other tasks simpler. MAYBE we could come up with some nifty formula that extracts the values you want from the cells and then sums them, but nothing easy comes to mind and I start thinking of a macro.

    You may be able to use some custom formatting and creative cell formatting to get something that looks similar to what you are presenting. For the purpose of this 'guide' lets assume you currently have this concatenated text and formulas in one of your columns.
    X/Y/Z

    Instead of one column, use three columns. The first column will be your calculated X and then right justified in the cell. The middle column will be Y and centered in the cell and using this custom number format "/"#"/". The last column would be your Z and left justified in the cell. I know it will not look exactly the same, but you can then sum up those numbers to your heart's content.

+ 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. Combine VLOOKUP and SUMIF to return sum of user-defined ranges in a table
    By sciondraconis in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-27-2014, 03:27 AM
  2. How to build a dynamic matrix table with user defined no.of rows and no.of columns
    By santhosh51 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-20-2013, 03:58 AM
  3. User-defined function to compare value to a table and display corresponding value
    By catwithafiddle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2013, 08:01 PM
  4. [SOLVED] Passing a table reference to a user defined function?
    By WGAshmore in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2012, 06:32 PM
  5. User defined function to output multiple values
    By firefly2k8 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2010, 12:03 PM
  6. [SOLVED] Clearing all values in a User Defined Type variable
    By J Streger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-27-2006, 03:10 PM
  7. Returning Values From a User-Defined Type
    By BobbyMurcerFan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2006, 02:58 PM
  8. [SOLVED] How to access MSSQL table in a user defined function
    By tek.hong@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-28-2006, 12:10 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