+ Reply to Thread
Results 1 to 17 of 17

Formula To Remove Blank Cells

  1. #1
    Registered User
    Join Date
    09-11-2008
    Location
    Ottawa
    Posts
    42

    Formula To Remove Blank Cells

    Hi,

    I have COLUMN B which goes from B2:B4000. Most cells have a text entry but a number of them are empty. I would like to put the entire list in COLUMN C less the blank entries. I want to use a formula, not a filter.

    Appreciate any help.



    Thanks


    TB

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

    Enter this formula in an available cell:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    where X1 is the cell you entered the Countif formula in.

    then the formula must be confirmed with CTRL+SHIFT+ENTER not just ENTER...

    And then copy it down to C4000
    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
    09-11-2008
    Location
    Ottawa
    Posts
    42
    Hi,

    I put your firdt code into COLUMN E and it returned a vale of 3378.

    I put the second value into COLUMN F and the cells all took on a blue outline. and only cell F2 returned an entry?


    Thanks for trying.

    Here is an example of the 2 columns I have. I put a formula in column C to add the "A". I want Column D to list columnC without the spaces. I hope that is a little clearer;

    Cant get the columns to separate. The entries "A-LS" are in column c.


    COLUMN B COLUMN C
    LS A - LS
    LS A - LS

    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    LS A - LS
    MARCOM
    JAG
    LS A - LS
    ADM(PA)

    ADM(PA)
    ADM(PA)
    AIRCOM
    LS A - LS
    LS A - LS
    JAG
    LS A - LS



    Thanks again
    Last edited by King_Quake; 09-24-2008 at 02:50 PM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Did you change the X1 in the formula to E1 or E2 (wherever you put the Countif formula)?

    Also did you confirm the formula with CTRL+SHIFT+ENTER so that { } brackets appeared around the formula...? then copied down.

  5. #5
    Registered User
    Join Date
    09-11-2008
    Location
    Ottawa
    Posts
    42
    Hi,

    Yes to the first question.

    I did not see any of the squiggly brackets, I will try it again.


    Thanks

  6. #6
    Registered User
    Join Date
    09-11-2008
    Location
    Ottawa
    Posts
    42
    Hi NVBC,

    I did what you said and of course it worked perfectly. Sorry for my sloppy entries. I really appreciate the help. I wish I had the aptitude for these formulas, but I will never be a programmer.


    Thanks again.

  7. #7
    Registered User
    Join Date
    01-15-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2013
    Posts
    1

    Re: Formula To Remove Blank Cells

    Signed up just to see the formula example... So glad I did, you life saver.
    Thanks

  8. #8
    Registered User
    Join Date
    04-17-2013
    Location
    Sierra Vista, AZ
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Formula To Remove Blank Cells

    I tried to modify this formula to work with blank cells in a row instead of a column. This is what I have so far:
    =IF(COLUMNS($AV$27:AV27)>$AR$45,"",INDEX(AV27:BP27,SMALL(IF(AV27:BP27<>"",COLUMN(AV27:BP27)-COLUMN(AV27)+1),COLUMNS($AV$27:AV27))))
    Where ROW AV27:BP27 is where the data exists that contain blank cells. It seemed to work with the first box, but when I dragged the formula across the row, it returned #NUM. It's probably something with the $. Whatever it is, I'm stuck...

  9. #9
    Registered User
    Join Date
    04-27-2013
    Location
    cancun, japan
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Formula To Remove Blank Cells

    Wohooo works!. Thank you I had a problem with #NUM! error appearing once the numbers on column b were finished but found a way round. Thanks!

  10. #10
    Registered User
    Join Date
    05-10-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Formula To Remove Blank Cells

    Dear NBVC,
    can you help me in the same condition?
    I have a sheet column A like this:

    abc
    fr
    ejr

    2
    35
    656

    78
    jfor

    I want my column B to show the same values in same order they are in Column A without any blank cell inside. That is, my Column B should look like follows:

    abc
    fr
    ejr
    2
    35
    656
    78
    jfor

    I tried day long with this solution but I do not know why it is not working! Can you help me out please? I need it very urgently!
    Advance thanks.

    Quote Originally Posted by NBVC View Post
    Did you change the X1 in the formula to E1 or E2 (wherever you put the Countif formula)?

    Also did you confirm the formula with CTRL+SHIFT+ENTER so that { } brackets appeared around the formula...? then copied down.

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Formula To Remove Blank Cells

    Rishad...Welcome to the Forum.

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  12. #12
    Registered User
    Join Date
    05-10-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Formula To Remove Blank Cells

    Thank you so much FDibbins! I am new you know. Thanks a lot. But I cannot find the link to start a new thread!
    Can you help in this regard?

  13. #13
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Formula To Remove Blank Cells

    Rishad,

    To start a new thread - read this - Once you click on www.excelforum.com which is the home page, you will see many subforums listed there. Click on the subforum relevant to your question. It will open up the page containing all the threads created in that subforum. On the top of the page, you will see a blue button called "+Post New Thread". Click on that button and proceed.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  14. #14
    Registered User
    Join Date
    02-01-2014
    Location
    BRISTOL, EBNGLAND
    MS-Off Ver
    Excel 2008
    Posts
    2

    Re: Formula To Remove Blank Cells

    I have been searching high and low for a formula that will do just what you describe in excel mac 2008. Nothing seems to work, and I am hoping that the code discussed will finally do the job. However, I cannot find it. The post which is supposed to contain the code instead contains an invitation to log into the forum, despite my already being here... Please, I would be most grateful if you could repost the code for copying data from one column to another sans blanks!

  15. #15
    Registered User
    Join Date
    02-01-2014
    Location
    BRISTOL, EBNGLAND
    MS-Off Ver
    Excel 2008
    Posts
    2

    Re: Formula To Remove Blank Cells

    Hi NBVC, I can't seem to copy the code from this post. I have been seeking exactly what is described here, and am praying that ive finally found it! Please could you repost it?

  16. #16
    Registered User
    Join Date
    04-17-2013
    Location
    Sierra Vista, AZ
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Formula To Remove Blank Cells

    I will be happy to repost the code. Unfortunately, the spreadsheet it is in is at work, so I won't be able to post it until Monday. I will write back with the formula on Monday evening.

  17. #17
    Registered User
    Join Date
    04-17-2013
    Location
    Sierra Vista, AZ
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Formula To Remove Blank Cells

    Formula to remove blank cells.xlsx

    In a hurry, don't have time to explain. But this is the tracker that contains the formula you're looking for. I'll reply again tomorrow to further explain.

+ 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. Excel doesn't think blank cells are not really blank?
    By leonnord in forum Excel General
    Replies: 3
    Last Post: 08-01-2007, 02:34 PM
  2. Macro to Fill Blank Cells
    By floridagunner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2007, 04:50 PM
  3. Subtraction macro request ...
    By rocket1406 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-13-2007, 03:10 PM
  4. [SOLVED] Placing a formula into merged cells!!!
    By ghostly1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-27-2007, 10:55 AM
  5. Locking non blank cells in range
    By chris100 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2007, 08:22 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