+ Reply to Thread
Results 1 to 5 of 5

Formula to Return non-blank values from a column

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Formula to Return non-blank values from a column

    I have seen similar questions w/ responses, but have been unable to modify the solutions to fit my needs.

    There is a worksheet with relevant data in columns D and O (other columns don't matter). Where the data in column O acts as a flag and is either blank or populated with "Watch List" depending on two different variables.

    I am looking for a formula (non-array) that will return only the non-blank cells in column O with the corresponding value in column D (for the same row). For instance: D2 = A123 and O2 = Watch List, I would like the formula to return A123.

    Any help would be greatly appreciated.
    Thanks!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to Return non-blank values from a column

    In a new column.. say P2 enter formula:

    =IF(O2<>"",COUNT(P$2:P2)+1,"")

    copied down

    Then to retrieve the data in a new column:

    =IFERROR(INDEX(D:D,MATCH(ROWS($A$2:$A2),$P:$P,0)),"")

    copied down until you get blanks...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    05-22-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Formula to Return non-blank values from a column

    Thank you very much for you response. Unfortunately, I am not getting the desired result. For the first statement that I placed in column P, I get a circular reference warning (may be okay, just want to confirm that is expected). When I use the 2nd formula, all I receive are zeroes.

    I have attached a sample of the data I am using, if this may help. I have hidden all of the rows between D and O.Data Sample.xlsx

    Thank you again.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula to Return non-blank values from a column

    That formula in P2 should have been:

    =IF(O2<>"",COUNT(P$1:P1)+1,"")

    copied down.... sorry.

  5. #5
    Registered User
    Join Date
    05-22-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Formula to Return non-blank values from a column

    Worked perfectly! Thanks again.

+ 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