+ Reply to Thread
Results 1 to 5 of 5

How to reference text from a range in one column depending on text in another column.

  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel for Mac 2011
    Posts
    22

    Question How to reference text from a range in one column depending on text in another column.

    Hi,

    I am trying to create a formula that will display text from a range of cells in a column depending on text in another range. For example -

    A B
    1 David EARLY
    2 Richard LATE
    3 Sarah DAY
    4 Sam OFF
    5 Daniel NIGHTS
    6 Marc OFF

    I want a separate cell that will for example, display Richard because he is on LATE. I thought =COUNTIF(b1:b6, "LATE", A1:A6) might work, but this doesn't display the text as it isn't a number. Does a formula exist for this?

    Many thanks,

    Richard

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to reference text from a range in one column depending on text in another column.

    Hi,

    Perhaps

    =INDEX(A:A,MATCH("LATE",B:B,False),1)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    05-04-2014
    Location
    New Jersey, United States
    MS-Off Ver
    Excel 2010, 2013
    Posts
    120

    Re: How to reference text from a range in one column depending on text in another column.

    I noticed you have multiple people with a status of "OFF". See if you can adapt the setup in the attached file. Notice that the formula is surrounded by curly brackets. This means that it is an array formula and it must be confirmed with ctrl+shift+enter.

    Book1.xlsx

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to reference text from a range in one column depending on text in another column.

    Maybe this

    In D2 enter this array formula then copy it down and then to the right.

    =IFERROR(INDEX($A:$A,SMALL(IF($B$1:$B$6=D$1,ROW($B$1:$B$6)),ROWS(D$1:D1))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    1
    David EARLY EARLY LATE DAY NIGHTS OFF
    2
    Richard LATE David Richard Sarah Daniel Sam
    3
    Sarah DAY Marc
    4
    Sam OFF
    5
    Daniel NIGHTS
    6
    Marc OFF
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Registered User
    Join Date
    04-22-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel for Mac 2011
    Posts
    22

    Re: How to reference text from a range in one column depending on text in another column.

    Thanks for all the answers - Richard Buttrey yours worked perfectly. Thank you.

+ 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] How to get results depending of a text in other column?
    By rwilson91 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-09-2013, 09:11 AM
  2. cell B will automatically show a text depending on the text on column A
    By Elainefish in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-05-2013, 05:57 AM
  3. Automatically pop up a number in column B depending on the text from column A
    By Elainefish in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2013, 07:48 AM
  4. [SOLVED] Cond. formatting a column/Range, highlight cell in column/range if equal to specific text
    By DFrank231 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2013, 03:35 PM
  5. Moving a row of text to another worksheet depending on a column
    By cherieA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2010, 06:01 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