+ Reply to Thread
Results 1 to 17 of 17

Find text in column and return adjacent cell

  1. #1
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Find text in column and return adjacent cell

    Hi,

    I have in column F a cell (which is dynamic, between F8:F400) which has the text "01 Incident Number".

    I need a formula which finds this text, gets the relevant text from the adjacent cell and then pastes that adjacent text in cell C4.

    Any help please???

    Thanks in advance.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find text in column and return adjacent cell

    Quote Originally Posted by frostii View Post
    gets the relevant text from the adjacent cell
    What column would the adjacent cell be in?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Find text in column and return adjacent cell

    Assuming adjacent cell is in Column G then in c$:

    =INDEX($G$8:$G$400,MATCH("01 incident number",$F$8:$F$400,0))

    Change G if required

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Find text in column and return adjacent cell

    Obviously C$. should be C4!

  5. #5
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Re: Find text in column and return adjacent cell

    Quote Originally Posted by JohnTopley View Post
    Assuming adjacent cell is in Column G then in c$:

    =INDEX($G$8:$G$400,MATCH("01 incident number",$F$8:$F$400,0))

    Change G if required
    Thanks for the very quick reply!

    Unfortunately I'm getting a 0 as my result.

    In the report I'm generating the "01 Incident Number" is in cell F161, with the text I'm after in cell G161. I need G161 to display in cell C4.

    Am I missing something?

    Thanks again.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Find text in column and return adjacent cell

    Check G161 : you will get 0 if it is empty. I have just used the formula with data in F161 & G161 .. no problem

  7. #7
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Re: Find text in column and return adjacent cell

    My spreadsheet has "20150626N1" in cell G161. This is what I want to display in cell C4, but all I get is a 0!!!!!

    Thank you anyway, I'm at a loss as to what is going on.....

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Find text in column and return adjacent cell

    It does work. See attached. Are you sure that there are no leading/trailing spaces in 01 Incident Number? Are you sure that there are no non-printing symbols in your data (frequently found i stuff downloaded from the www).

    can you post your sheet?
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  9. #9
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Re: Find text in column and return adjacent cell

    File attached. The information I pasted had lots of formatting issues, me thinks the problem lies there.....
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Find text in column and return adjacent cell

    There are TWO cells with "01 Incident Number" and the first has G cell blank: hence zero: MATCH will find the first occurrence of any match.

    So where do we go from here?

  11. #11
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Re: Find text in column and return adjacent cell

    OH NOOOOOOOO!!!!

    I didn't even see that first one haha. What a goose. That throws a bit of a spanner in the works.

    The idea behind all this is to clean up a horribly formatted report through a macro, including the incident number in bold at the top of the document. If the report has more than one instance of 01 Incident Number, then I give up!

    Thank you so much for your time anyway.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Find text in column and return adjacent cell

    No problem. If you feel the forum can help please come back.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Find text in column and return adjacent cell

    You can easily return that LAST matching value, if that helps....

  14. #14
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Re: Find text in column and return adjacent cell

    That would help, but how does one go about that? What changes in the above formula?

    Thanks in advance.

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find text in column and return adjacent cell

    Assuming the value to return is in column G...

    A1 = 01 Incident Number

    =LOOKUP(2,1/(F8:F400=A1),G8:G400)

  16. #16
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Re: Find text in column and return adjacent cell

    Hi Tony,

    Thankyou, that seemed to do the trick!

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Find text in column and return adjacent cell

    You're welcome. Thanks for the feedback!

+ 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] Find next non blank cell in list and return value from adjacent column
    By kristy.brown in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-19-2014, 03:28 PM
  2. Find text in array & return adjacent cell value
    By econbizer in forum Excel General
    Replies: 13
    Last Post: 10-13-2012, 01:26 AM
  3. [SOLVED] Find text in a column or range and return value of adjacent cell
    By chemoul in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2012, 04:30 AM
  4. [SOLVED] Find Specific Text in Text String and Return Value in Adjacent Column
    By watchouse in forum Excel General
    Replies: 2
    Last Post: 07-11-2012, 03:53 PM
  5. Find and Match Text in Column Return Adjacent Cell
    By biancam in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-11-2012, 02:45 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