+ Reply to Thread
Results 1 to 4 of 4

How to obtain a value in a column cell contingent on the text entered in the column header

  1. #1
    Registered User
    Join Date
    10-24-2016
    Location
    Los Angeles, California
    MS-Off Ver
    MS Office 2016
    Posts
    5

    How to obtain a value in a column cell contingent on the text entered in the column header

    Hello, I have been beating my brain with this.

    I am trying to populate the value of a cell in a column when a specific text is entered in that column header cell.

    For example:

    If I enter the text of any given month in cell header "CQ5", let's say "Sep", I want the same values for that month "CW6-CW11" to populate in cells "CQ6-CQ11". I want the same info for the indicated month to be mirrored in column "CQ". If I enter the text for a different month in "CQ5", then I want the same result. That month's values populated in column "CQ".

    I have tried the following formula as a guess, but, I think since the data is in the middle of a spreadsheet the result is coming up wrong. I have other data within my spreadsheet that are not included in the result I am looking for.

    =HLOOKUP($CQ$5,$CR$5:$DC$11,ROW(),0)

    I have an example attached. Any assistance will be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    665

    Re: How to obtain a value in a column cell contingent on the text entered in the column he

    =INDEX($CR$5:$DC6,ROW()-4,MATCH($CQ$5,$CR$5:$DC$5,0))
    And Copy it down

    If you make CQ5 a conditional list - it forces a correct option (Instead of mistype)

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

    Re: How to obtain a value in a column cell contingent on the text entered in the column he

    In your formula the table range is: $CR$5:$DC$11. Note that the first row of the range is actually row five of the worksheet. Therefore your data values (row two of the range, start on row six of the sheet. Using ROW() with empty parentheses returns the worksheet row of the cell the formula is in (row six in this case) to the formula. So your formula starts counting at ws row 5 and returns the value 6 rows down from there. You actually want to start at range row 2, so:
    Please Login or Register  to view this content.
    **ROW(A2) returns 2 to the formula.
    Last edited by protonLeah; 07-07-2020 at 04:55 PM.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    10-24-2016
    Location
    Los Angeles, California
    MS-Off Ver
    MS Office 2016
    Posts
    5

    Thumbs up Re: How to obtain a value in a column cell contingent on the text entered in the column he

    I implemented the formula CRIMEDOG provided and it worked by providing the result I needed.

    Thank you CRIMEDOG and protonLeah for your responses and assistance.

+ 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. Return a column header based on text in a cell
    By sdeel1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-05-2016, 03:02 PM
  2. macro to lock cell by column header based on value in another cell by column header
    By Closet Guru in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2015, 12:36 PM
  3. [SOLVED] Dynamically match Column header text to sum column on another worksheet
    By swiftrain in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-20-2015, 04:50 PM
  4. Replies: 1
    Last Post: 02-24-2014, 10:48 PM
  5. Replies: 1
    Last Post: 01-30-2014, 01:42 PM
  6. When text is entered Column A, Column B will display current date
    By Jack of Diamond in forum Excel General
    Replies: 2
    Last Post: 06-22-2008, 01:22 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