+ Reply to Thread
Results 1 to 7 of 7

Equals cell unless blank

  1. #1
    Forum Contributor
    Join Date
    07-17-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel for O365
    Posts
    197

    Equals cell unless blank

    Hi all,

    -----A---------------B-----
    1--Apple---------Apple
    2-----------------Bannana
    3--Bannana-----Orange
    3--Orange-------Pear
    4-----------------Kiwi
    5-----------------Strawberry
    6--Pear----------------------
    7--Kiwi----------------------
    8-----------------------------
    9--Strawberry---------------


    In column A I have a column of data that I'm trying to replicate into column B. I want to ignore the blank cells so only populated ones are copied into column B. Does anybody know how I can do this? Expected results in Column B.

    **NOTE - I know a pivot table would remove the blanks but for this excercise I can't use a pivot table and needs to be formula based not VB

    Many thanks in advance

    Jason

  2. #2
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Equals cell unless blank

    =index(A1:A100,match(1,Countifs($B$1:b1,A1:100),0)
    Use Ctrl+Shift+enter
    Check the attachment for example
    Punnam
    Attached Files Attached Files
    Last edited by Punnam; 09-08-2014 at 06:19 AM.

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

    Re: Equals cell unless blank

    exercise? is this class work
    "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

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Equals cell unless blank

    @Punnam: Looks like the forum has corrupted your formula

    This works

    =IFERROR(INDEX(A$1:A$14,SMALL((IF(LEN(A$1:A$14),ROW(INDIRECT("1:"&ROWS(A$1:A$14))))),ROW(A1)),1),"")

    Array formula use Ctrl-Shift-Enter

    Source: http://www.cpearson.com/excel/noblanks.aspx
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Forum Contributor
    Join Date
    07-17-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel for O365
    Posts
    197

    Re: Equals cell unless blank

    Quote Originally Posted by Special-K View Post
    @Punnam: Looks like the forum has corrupted your formula

    This works

    =IFERROR(INDEX(A$1:A$14,SMALL((IF(LEN(A$1:A$14),ROW(INDIRECT("1:"&ROWS(A$1:A$14))))),ROW(A1)),1),"")

    Array formula use Ctrl-Shift-Enter

    Source: http://www.cpearson.com/excel/noblanks.aspx
    Cool, works perfectly.

    If I want the range of cells to lookup to C13:C412 insted of A1:14, what do I need to change?

    Tried this but didn't work...

    =IFERROR(INDEX(C$13:C$412,SMALL((IF(LEN(C$13:C$412),ROW(INDIRECT("13:"&ROWS(C$13:C$412))))),ROW(C13)),3),"")

    Thanks again!

  6. #6
    Forum Contributor
    Join Date
    07-17-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel for O365
    Posts
    197

    Re: Equals cell unless blank

    Nevermind, got it...

    =IFERROR(INDEX(C$13:C$26,SMALL((IF(LEN(C$13:C$26),ROW(INDIRECT("1:"&ROWS(C$13:C$26))))),ROW(A1)),1),"")


    Thanks all!

  7. #7
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Equals cell unless blank

    @ Special -k

    Thanks for giving me a new way of approach .

    The formula i used is the attached workbook is the correct & works fine to retrieve the unique values in column ,one and the same is below

    =IFERROR(INDEX($A$1:$A$11,MATCH(0,COUNTIF($B$1:B2,$A$1:$A$11),0)),"").

    Punnam

  8. #8
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Equals cell unless blank

    @ jwillis07,

    Kindly confirm me whether my post 2 is working for you ?

    Punnam

+ 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. Counting if 1 cell equals X and another equals Y
    By SianPE in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-08-2014, 06:39 AM
  2. Replies: 1
    Last Post: 11-28-2013, 02:16 AM
  3. [SOLVED] Addition to formula for blank cell when figure equals 6
    By AMD1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-19-2013, 05:59 PM
  4. Lookup two conditions (equals and not blank)
    By tomlancaster in forum Excel General
    Replies: 5
    Last Post: 05-06-2010, 11:27 AM
  5. An equals formula that doesn't return a blank cell
    By stanja in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-30-2009, 03:37 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