+ Reply to Thread
Results 1 to 7 of 7

Fill Cell Based on Searched Text from Neighboring Cell?

  1. #1
    Registered User
    Join Date
    02-06-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    3

    Fill Cell Based on Searched Text from Neighboring Cell?

    Team- this should be an easy one but I'm not seeing a solution online. I need to populate a cell based on text contained in the cell next to it.

    So, if A1 has the text "TEACHER, GRADE 4", then I need the cell next to it to auto-fill with "Johnson Elementary" based on the "grade 4", so it's not an absolute value- it has to look for that text substring.

    Thoughts?
    Thanks in Advance- Scott

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Fill Cell Based on Searched Text from Neighboring Cell?

    Hi Scott,

    Based on your one input...

    =IF(ISNUMBER(SEARCH("GRADE 4",A1)),"Johnson Elementary","")
    HTH
    Regards, Jeff

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Fill Cell Based on Searched Text from Neighboring Cell?

    Or ...

    =IF(COUNTIF(A1,"*GRADE 4*"),"Johnson Elementary","")

  4. #4
    Registered User
    Join Date
    02-06-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    3

    Re: Fill Cell Based on Searched Text from Neighboring Cell?

    Thanks a ton Jeff- that worked. And thanks Phuocam as well.
    If I may indulge your help one more time- now I have to modify this to cover any grade that might appear in the adjacent cell- so, if A1 has Grade 4 it would show Johnson Elementary, if A1 has GRADE 5 it must display Hoover Elementary, if Grade 6, MLK School, etc. There are a total of eight grades in adjacent cells with 5 corresponding schools...
    Thanks in advance!

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Fill Cell Based on Searched Text from Neighboring Cell?

    Maybe try a lookup table...

    B1 =VLOOKUP(MID(A1,FIND(",",A1)+2,LEN(A1)),C1:D8,2,0)

    Please Login or Register  to view this content.
    Or if you wanted to embed the table...

    B1 =LOOKUP(MID(A1,FIND(",",A1)+2,LEN(A1)),{"Grade 4","Jan";"Grade 5","Feb";"Grade 6","Mar";"Grade 7","Apr";"Grade 8","May";"Grade 9","Jun";"Grade 10","Jul";"Grade 11","Aug"})

    Of course just replace "Jan", "Feb" with your specific school names.

  6. #6
    Registered User
    Join Date
    02-06-2017
    Location
    USA
    MS-Off Ver
    2013
    Posts
    3

    Re: Fill Cell Based on Searched Text from Neighboring Cell?

    Thank you very much sir- I appreciate your help!

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Fill Cell Based on Searched Text from Neighboring Cell?

    You are very welcome. Thanks for the feedback.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 4
    Last Post: 01-10-2017, 01:01 AM
  2. Replies: 8
    Last Post: 10-28-2015, 10:22 AM
  3. [SOLVED] command button to fill color in cell based on text in another cell
    By gavwalsh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2014, 03:10 AM
  4. missing text or string in neighboring cell.
    By justexcel-lent in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 04-21-2014, 10:03 AM
  5. Replies: 2
    Last Post: 11-29-2012, 11:27 AM
  6. Replies: 0
    Last Post: 07-09-2012, 05:41 PM
  7. Replies: 1
    Last Post: 05-06-2010, 03:09 AM

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