+ Reply to Thread
Results 1 to 12 of 12

Search multiple fields for text when all but 1 are blank, and display that cell's text

  1. #1
    Registered User
    Join Date
    11-03-2013
    Location
    Pullman,WA
    MS-Off Ver
    Excel 2011
    Posts
    7

    Search multiple fields for text when all but 1 are blank, and display that cell's text

    Between A1:A9, text appears in one cell and the rest are blank.

    I want A10 to be populated with the 1 piece of text between A1:A9.

    When it was a number I could use:

    =max(a1:a9)

    How do I do it with text?

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    =LOOKUP(REPT("z",255),A1:A9)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    11-03-2013
    Location
    Pullman,WA
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    Will that diplay Z if the field is populated? The whole issue is, I have 9 columns in which a stock ticker appears only if it is the highest value. In the 10th column I want to check the first 9 and tell me the one piece of text that appeared in all of them.

    I've tried using if/or functions. I can't figure this out. I'm actually giving up and doing it all manually, but it seems like it should be simple.

    Thanks for trying though.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    nope it will display whatever text which is in column a1:a9 provided only on cell is filled
    did you try it?
    rept("z",255) is 255 z's since lookup cant find a string with 255 z's if returns the last value it can find
    Attached Files Attached Files
    Last edited by martindwilson; 11-03-2013 at 07:59 PM.

  5. #5
    Registered User
    Join Date
    11-03-2013
    Location
    Pullman,WA
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    It's not working... I don't understand why. It populates the correct value in the first cell, but as soon as the data is populated in another cell in the range it just displays nothing. I will upload the file I'm working with in a second.
    Last edited by joshz2012; 11-03-2013 at 08:15 PM.

  6. #6
    Registered User
    Join Date
    11-03-2013
    Location
    Pullman,WA
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    Here is the file showing it's not working. Look at row AE5 down to see it not working. It only populates the first cell with the value. From there, if the column with the data isn't the same as the first, it reads it as blank.

    Help appreciated.
    Attached Files Attached Files

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    its something to do with whats in the cells they are not truly blank something is being imported into them
    try =ISBLANK(B11) it returns false even though the cell appears blank

  8. #8
    Registered User
    Join Date
    11-03-2013
    Location
    Pullman,WA
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    Fair enough. I copied and "pasted values" so I'm not sure how to get rid of that. I'm close to just entering the data manually. But thanks for the suggestion.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    how did you paste? did you paste special text?

  10. #10
    Registered User
    Join Date
    11-03-2013
    Location
    Pullman,WA
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    No, i mean, all of these were populated by formulas. So I copied it into this workbook and pasted specials "Paste as values" so it would read as text and blank instead of all having equations.

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    ah its copied ""
    try
    =IFERROR(INDEX(B3:J3,MATCH(TRUE,INDEX(B3:J3<>"",0),0)),"")
    or
    =IFERROR(LOOKUP(2,1/(B3:J3<>""),B3:J3),"")
    Last edited by martindwilson; 11-03-2013 at 09:15 PM.

  12. #12
    Registered User
    Join Date
    11-03-2013
    Location
    Pullman,WA
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: Search multiple fields for text when all but 1 are blank, and display that cell's text

    That works perfectly, thank you!

    And that's right, I had them display "" so it would read as blank. But I have no idea how you figured that out, as I can't see the quotation marks in the formula bar.

    Thanks so much for the help!

+ 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. Search cell for multiple text , return comma separated text in separate cell if found
    By dangerdoug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2013, 01:52 PM
  2. [SOLVED] Formula to display cell if the text content partially matches a search term
    By Avestron in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-11-2013, 04:07 AM
  3. how to export the text data without blank fields
    By osamajamal in forum Excel General
    Replies: 5
    Last Post: 05-21-2012, 05:08 AM
  4. VBA - Check 3 rows if blank and display text in one of them in adjacent cell
    By guitalex in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2012, 09:32 AM
  5. Excel 2007 : Search for multiple text within a cell
    By northerng in forum Excel General
    Replies: 4
    Last Post: 01-27-2011, 11:50 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