+ Reply to Thread
Results 1 to 4 of 4

Sum of last 3 numbers in a range with gaps.

  1. #1
    Registered User
    Join Date
    12-21-2010
    Location
    Kabul, Afghanistan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Sum of last 3 numbers in a range with gaps.

    I have a range where some cells contain numbers and other (random) cells are empty. Can I calculate the sum of the last 3 numbers in that range with a single formula? What would such a formula have to look like? (Preferably, the formula will continue to work if I later expand the range and add new numbers and new gaps at the end.)

    Thanks.
    Last edited by donjoe; 01-08-2011 at 04:41 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,065

    Re: Sum of last 3 numbers in a range with gaps.

    Can you upload example excel workbook?
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    12-21-2010
    Location
    Kabul, Afghanistan
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Sum of last 3 numbers in a range with gaps.

    Never mind, found it on the Net. It's an array formula and for a range of Y5:Y11 it looks like this:

    {=SUM(INDEX(Y5:Y11;SMALL(IF(Y5:Y11<>"";ROW(Y5:Y11);"");COUNT(Y5:Y11)-3+1)-ROW(Y5)+1):Y11)}

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sum of last 3 numbers in a range with gaps.

    For a non-array formula...

    Referencing a specific range:
    Please Login or Register  to view this content.
    Referencing an entire column:
    Please Login or Register  to view this content.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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