+ Reply to Thread
Results 1 to 3 of 3

How to refer to column name from Excel table in formula

  1. #1
    Registered User
    Join Date
    02-06-2018
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2016
    Posts
    29

    How to refer to column name from Excel table in formula

    Hi guys,

    Is there a way to refer to the column name from a table in a formula using a cell reference?

    I am trying to count if my columns are non-blanks or blanks using the COUNTIFS function. The thing is that I am making a formula for this for each column in my table.

    So I have 4 columns in my table:

    Column 1 = Source File Column 2 = Apples Column 3 = Oranges Column 4 = Grapes

    So the formula looks like this
    =COUNTIFS(KS_CR2_1_ARK[Source File];CONCAT($C$2;".rvt");KS_CR2_1_ARK[Should be a reference to cells in A with the names ];">""")

    The thing is that if you use the table reference you need to select the correct name each time. However I would just like to refer to a list of names corresponding to the column name and drag the formula down.

    So the list would be:

    Cell = Name
    A1 = Apples
    A2 = Oranges
    A3 = Grapes

    So my formula for each would look like this

    =COUNTIFS(KS_CR2_1_ARK[Source File];CONCAT($C$2;".rvt");KS_CR2_1_ARK[A1];">""") => COUNTIFS(KS_CR2_1_ARK[Source File];CONCAT($C$2;".rvt");KS_CR2_1_ARK[Apples];">""")
    =COUNTIFS(KS_CR2_1_ARK[Source File];CONCAT($C$2;".rvt");KS_CR2_1_ARK[A2];">""") => COUNTIFS(KS_CR2_1_ARK[Source File];CONCAT($C$2;".rvt");KS_CR2_1_ARK[Oranges];">""")
    =COUNTIFS(KS_CR2_1_ARK[Source File];CONCAT($C$2;".rvt");KS_CR2_1_ARK[A3];">""") => COUNTIFS(KS_CR2_1_ARK[Source File];CONCAT($C$2;".rvt");KS_CR2_1_ARK[Grapes];">""")


    However I can't do this? Is there anyone who has an idea of how to do this?

  2. #2
    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,899

    Re: How to refer to column name from Excel table in formula

    You need the INDIRECT function: https://www.contextures.com/xlFunctions05.html
    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.

  3. #3
    Registered User
    Join Date
    02-06-2018
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2016
    Posts
    29

    Re: How to refer to column name from Excel table in formula

    AliGW thanks for your response. However I don't think that helps, since I need to look in the correct external data source that is named KS_CR2_1_ARK. I have more data sources with same column names, hence why I need to look in the specific ones.

+ 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] help with making formula refer to dynamic table
    By juntjoo in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 04-17-2017, 11:25 PM
  2. [SOLVED] Refer to last used column and fill formula
    By S1n1 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-26-2016, 02:47 PM
  3. [SOLVED] Refer to a cell in another column within a table
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-09-2014, 10:00 PM
  4. Excel formula for filling column refer to multiple criteria
    By TJTL in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-24-2012, 08:33 PM
  5. How to create formula index refer on refference table
    By poojiemilan in forum Excel General
    Replies: 1
    Last Post: 12-31-2011, 07:16 AM
  6. Formula to refer to changing Column
    By Kenny Markhardt in forum Excel General
    Replies: 1
    Last Post: 10-10-2005, 07:05 PM
  7. How to refer to current column in a formula?
    By jmg092548 in forum Excel General
    Replies: 4
    Last Post: 08-10-2005, 03:05 PM

Tags for this Thread

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