+ Reply to Thread
Results 1 to 4 of 4

Exclude empty cells

  1. #1
    Registered User
    Join Date
    06-11-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    Professional Plus 2010
    Posts
    28

    Exclude empty cells

    Hi everyone!

    The goal with this excel is to calculate the cost for certain items (fruits in this example) based on total value and the quantity.
    Then I want to export the data to another program (just with Clipboard, Ctrl+C)

    Please take a look at the example file where I have added the information needed, but now I need a simple way to export the data without the blank rows (H4:H19).

    Simplicity for the user is the key, so my first idea was to make a button with a macro that simply copy the range H4:H19, but then all the empty/blank rows is included.

    Hopefully it will make more sense after you look at the file, but otherwise please let me know and I will try to explain my question better.

    Maybe there is a totally different solution that is better?
    Grateful for your help!

    BR,
    Erik
    Attached Files Attached Files

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

    Re: Exclude empty cells

    =IFERROR(INDEX($A$4:$A$19,SMALL(IF(($C$4:$C$19<>0),ROW($A$4:$A$19)-3),ROW(A1)),1),"")
    Array formula, use Ctrl-Shift-Enter

    copy down for as many rows as you have in column A
    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.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Exclude empty cells

    Here is a non-arrayed solution (very similar to Special K's)

    In A26 copied down and across

    =IFERROR(INDEX(A$4:A$19,AGGREGATE(15,6,(ROW($A$4:$A$19)-ROW($A$4)+1)/($C$4:$C$19>0),ROWS($A$26:$A26))),"")
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    06-11-2015
    Location
    Stockholm, Sweden
    MS-Off Ver
    Professional Plus 2010
    Posts
    28

    Re: Exclude empty cells

    Thank you guys!
    Sorry it took me so long to answer, but I went for Special Ks solution and it worked like a charm.

+ 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. [SOLVED] Count according to date & exclude empty cells
    By Lukael in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-06-2015, 04:39 AM
  2. [SOLVED] Exclude empty cells from a calculation
    By Andrew87.. in forum Excel General
    Replies: 9
    Last Post: 01-03-2015, 11:28 AM
  3. Excel 2007 : exclude empty cells
    By maniac099 in forum Excel General
    Replies: 7
    Last Post: 06-17-2012, 10:53 AM
  4. Exclude empty cells
    By klund in forum Excel General
    Replies: 10
    Last Post: 05-05-2009, 06:42 AM
  5. Replies: 7
    Last Post: 01-27-2009, 10:42 PM
  6. How do I exclude empty cells from being printed?
    By pox in forum Excel General
    Replies: 1
    Last Post: 08-13-2005, 07:05 AM
  7. How to exclude cells that are empty?
    By aijihz in forum Excel General
    Replies: 1
    Last Post: 03-30-2005, 02:06 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