+ Reply to Thread
Results 1 to 2 of 2

Refer to columns by "field headings" in an Excel Table / eliminate dynamic named ranges

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Refer to columns by "field headings" in an Excel Table / eliminate dynamic named ranges

    I have a “database” in excel with 193 dynamic named ranges
    Most columns are a dynamic named range. Some use the OFFSET & COUNTA functions and some use the INDEX & COUNTA functions.

    In my calculating workbook I have many formulas such as the one below:

    { = IF(ISERROR(INDEX(‘CCDatabase.xlsm'!RngDbRMSL,MATCH(1,(‘CCDatabase.xlsm'!RngDbRMCD=$CU24)*(‘CCDatabase.xlsm'!RngDbRMG = $CH24)*( ‘CCDatabase.xlsm'!RngDbRMSL>=$CP24),0),1)),
    MAX(IF(‘CCDatabase.xlsm'!RngDbRMCD=$CU24,IF( ‘CCDatabase.xlsm'!RngDbRMG = $CH24,’CCDatabase.xlsm'!RngDbRMSL))),
    INDEX(‘CCDatabase.xlsm'!RngDbRMSL,MATCH(1,(‘CCDatabase.xlsm'!RngDbRMCD=$CU24)*( ‘CCDatabase.xlsm'!RngDbRMG = $CH24)*(‘CCDatabase.xlsm'!RngDbRMSL>=$CP24),0),1)) }

    (FYI, “RM” is the code for the sheet name and “SL” is the code for the column name so I know what the named range means and it’s location.)

    Unfortunately the database has to be open for most of my formulas to calculate.

    If I change my ranges of data in the database to Excel “TABLES” (Insert > Table) can I then somehow refer to the columns by their headers and eliminate my dynamic named ranges?

  2. #2
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Refer to columns by "field headings" in an Excel Table / eliminate dynamic named range

    If you type = and then select the header and the existing data in that column in a table Excel will show you the syntax you need to refer to the data in the column. I have a table named ExerciseData, one of the headers is named TotalReps, If I just select the header I get:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If I select the header and all the existing data in that column I get:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    To add up the column and have it be dynamic I type =Sum( and then select the header and the data), I then get a formula that updates when I add to the table. The formula looks like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    So this should give you an idea of the syntax required if you want to type your formulas as opposed to selecting the data, which is the easiest since Excel will do the hard stuff for you.

    Good Luck.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

+ 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. Dynamic named range that expands "horizontally"
    By adelkam in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-19-2016, 11:07 AM
  2. Display "TEXT" in "Values" field in PIVOT TABLE using VBA!!
    By meus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2015, 09:56 AM
  3. Display "TEXT" in "Values" field in PIVOT TABLE using VBA!!
    By meus in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-04-2015, 06:14 AM
  4. Error when "mirroring" named ranges between worksheets
    By fishermanryan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2014, 07:04 PM
  5. 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
  6. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  7. Set the "RefersTo" property of Named Ranges
    By m3atball in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2010, 02:51 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