+ Reply to Thread
Results 1 to 7 of 7

Trying to remove blank cells from columns, problems with IFERROR formula.

Hybrid View

  1. #1
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    262

    Trying to remove blank cells from columns, problems with IFERROR formula.

    I'm trying to perform the simple task of removing the blank cells from two columns. I did some research & found this formula online:
    Formula: copy to clipboard
    =IFERROR(INDEX(BlanksRange,SMALL((IF(LEN(BlanksRange),ROW(INDIRECT("1:"&ROWS(BlanksRange))))),ROW(A1)),1),"")

    and then adapted it to my purposes:
    Formula: copy to clipboard
    =IFERROR(INDEX($B$2:$B$1000,SMALL((IF(LEN($B$2:$B$1000),ROW(INDIRECT("1:"&ROWS($B$2:$B$1000))))),ROW(E2)),1),"")

    That works perfectly, but when I try to do the same for the column right next to the first column, it doesn't work. Here's the formula I used for that column:
    Formula: copy to clipboard
    =IFERROR(INDEX($C$2:$C$1000,SMALL((IF(LEN($C$2:$C$1000),ROW(INDIRECT("1:"&ROWS($C$2:$C$1000))))),ROW(F2)),1),"")

    Maybe I'm not understanding the syntax of the formula like I should and adapting the formula incorrectly?

    Any insight would be greatly appreciated.
    Attached Files Attached Files
    Last edited by Big.Moe; 06-15-2017 at 02:04 PM. Reason: Wrong Excel File Uploaded

  2. #2
    Forum Contributor
    Join Date
    01-05-2017
    Location
    New York
    MS-Off Ver
    Office 2016
    Posts
    206

    Re: Trying to remove blank cells from columns, problems with IFERROR formula.

    If VBA is an option, you can take the below code and copy it into a module in your personal macro workbook. Then you can just select the columns and press ctrl+shift+R and all blank cells will be removed.
    Sub Remove_Blanks()
    '
    ' Remove_Blanks Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+R
    '
        Selection.SpecialCells(xlCellTypeBlanks).Select
        Selection.Delete Shift:=xlUp
    End Sub

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

    Re: Trying to remove blank cells from columns, problems with IFERROR formula.

    Use this instead, it may need tweaking, post your actual file if this doesnt work

    =IFERROR(INDEX($C$2:$C$1000,SMALL(IF(($C$2:$C$1000<>""),ROW($A$1:$A$1000)),ROW(A1)),1),"")
    Array formula, use Ctrl-Shift-Enter
    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.

  4. #4
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    262

    Re: Trying to remove blank cells from columns, problems with IFERROR formula.

    Quote Originally Posted by Special-K View Post
    Use this instead, it may need tweaking, post your actual file if this doesnt work

    =IFERROR(INDEX($C$2:$C$1000,SMALL(IF(($C$2:$C$1000<>""),ROW($A$1:$A$1000)),ROW(A1)),1),"")
    Array formula, use Ctrl-Shift-Enter
    Hmmm....your formula does the same thing. Must be something within my spreadsheet.

    Here's my file & the sheet in question is "REF CALCS". My apologies, I attached the wrong file on my original post.

    If you have a minute to take a quick look, I would be very appreciative.
    Attached Files Attached Files

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Trying to remove blank cells from columns, problems with IFERROR formula.

    There are error values within Column C, beginning at C531.

    If I clear the contents from that row and down, then the formula works as expected.

  6. #6
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    262

    Re: Trying to remove blank cells from columns, problems with IFERROR formula.

    Quote Originally Posted by Jonmo1 View Post
    There are error values within Column C, beginning at C531.

    If I clear the contents from that row and down, then the formula works as expected.
    Jonmo1, you are a genius....and I am a total tool!

    I can't believe I didn't even take the time to check all the way down the range. My apologies for wasting you guys' time for such a stupid mistake......but many thanks nevertheless!

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Trying to remove blank cells from columns, problems with IFERROR formula.

    You're welcome.

+ 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: 9
    Last Post: 11-23-2016, 12:22 PM
  2. [SOLVED] How to remove blank cells that contain formula using VBA code
    By Noobieman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2016, 06:29 AM
  3. Formula To Remove Blank Cells
    By King_Quake in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 02-04-2014, 12:59 AM
  4. [SOLVED] Remove blank cells that contain a formula
    By killerthun in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-04-2013, 02:23 PM
  5. Aggregate data in a range of columns to remove blank cells
    By arbgd1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2013, 04:11 PM
  6. Function similar to IFERROR but for blank and zero cells?
    By Alabaster in forum Excel General
    Replies: 1
    Last Post: 12-10-2011, 05:15 PM
  7. Excel 2007 : iferror(index Formula returning blank cells
    By Martin Chamberlin in forum Excel General
    Replies: 7
    Last Post: 11-15-2011, 08:45 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