+ Reply to Thread
Results 1 to 14 of 14

Find text in array & return adjacent cell value

Hybrid View

  1. #1
    Registered User
    Join Date
    05-03-2012
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Find text in array & return adjacent cell value

    Dear all, I'm pretty muddled with this & would appreciate your help!

    I'm looking for a cell reference solution to finding any "text/number" in a given array & returning an adjacent cell value.
    The adjacent cell being called should be dynamic.. could be (3 rows down, 1 right) or even (5 rows down, 6 right).

    For eg, cell B2 will contain the formula, to find the text "Syllabus e01932 summer" in my given array & then returning its adjacent cell value, "26" (3 rows down, 1 column right).

    Please see the attached screen shot/workbook!
    I wish to solve this using cell formulas & not vba macros.


    Thank you,
    eb

    Find text in array return adjacent cell value.JPG
    Find text in array return adjacent cell value.xls
    Last edited by econbizer; 05-07-2012 at 03:59 AM. Reason: to make my qn clearer

  2. #2
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Find text in array & return adjacent cell value

    You have the search criteria in F4, is that always going to be the case or could that beanywhere in the array? will the cell you wish returned always be at the same offset? A little more explanation is required, also will the lookup taxt always be the same or are you hoping to enter that each time into B2?
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  3. #3
    Registered User
    Join Date
    05-03-2012
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Find text in array & return adjacent cell value

    Quote Originally Posted by scottylad2 View Post
    You have the search criteria in F4, is that always going to be the case or could that beanywhere in the array? will the cell you wish returned always be at the same offset? A little more explanation is required, also will the lookup taxt always be the same or are you hoping to enter that each time into B2?
    Dear scottylad2,

    You have hit my problem spot on! Very sharp!

    Yes it has to be dynamic such that we can search for any text in the array & obtain an adjacent cell value.
    For example, we could instead search for "Charts" to return an adjacent cell offset (1,2) to return "screen".
    Or we could search for "165" to return an adjacent cell offset (0,2) to return "364".

    Thank you

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,829

    Re: Find text in array & return adjacent cell value

    Put the text you wish to find in B1 and this formula in B2:

    =INDEX(G:G,MATCH(B1,F:F,0)+3)

    This will return an error if the text is not found - you can avoid the error like this:

    =IF(ISNA(MATCH(B1,F:F,0)),"",INDEX(G:G,MATCH(B1,F:F,0)+3))

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    05-03-2012
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Find text in array & return adjacent cell value

    bump.. any suggestions on this?

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Find text in array & return adjacent cell value

    Before I even a read a post please upload example workbook rather then a picture.
    I'm very bad at drawing

  7. #7
    Registered User
    Join Date
    05-03-2012
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Find text in array & return adjacent cell value

    Quote Originally Posted by zbor View Post
    Before I even a read a post please upload example workbook rather then a picture.
    I'm very bad at drawing
    Hi zbor, thanks for replying..
    I've attached the workbook.

    I'm looking for a cell reference solution to finding any "text/number" in a given array & returning an adjacent cell value.
    The adjacent cell being called should be dynamic.. could be (3 rows down, 1 right) or even (5 rows down, 6 right).

    Thank you,
    eb

    Find text in array return adjacent cell value.xls

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Find text in array & return adjacent cell value

    Maybe this:

    =INDEX($B$5:$H$9,3,1+MATCH("Syllabus e01932 summer",$B$4:$H$4,0))

  9. #9
    Registered User
    Join Date
    05-03-2012
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Find text in array & return adjacent cell value

    Quote Originally Posted by zbor View Post
    Maybe this:

    =INDEX($B$5:$H$9,3,1+MATCH("Syllabus e01932 summer",$B$4:$H$4,0))
    Hi zbor, thanks for your suggestion.
    The formula should be able to find anything within the set array.


    B4:H9 is a set array in the .xls example, and there should be no fixed headers.
    ie. if I were to search for "73" to return an adjacent cell (2,1), it will return "634".



    Thank you,
    eb

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Find text in array & return adjacent cell value

    How do you define what you looking and where is start of your array?

  11. #11
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Find text in array & return adjacent cell value

    This is how i read the question:

  12. #12
    Registered User
    Join Date
    05-03-2012
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Find text in array & return adjacent cell value

    Quote Originally Posted by WHER View Post
    This is how i read the question:
    Awesome
    Thanks WHER, a ONE step solution.. trademark of a cool programmer!
    Thanks also to your replies guys!


    Thank you,
    eb

  13. #13
    Registered User
    Join Date
    10-12-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Find text in array & return adjacent cell value

    Hi WHER,

    I notice that you are good in this hence I am here to seek your assistance. What I'm trying to do is, to search for column "K" values in the array of column "E", and produce the based in column "F". However, if the value in column "F" is "ACTIVE", I would then want to produce the result in column "G" instead. If the value is not found in column "E", it will then produce a result of "CHECK".

    Please assist.
    Attached Files Attached Files

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

    Re: Find text in array & return adjacent cell value

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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