+ Reply to Thread
Results 1 to 6 of 6

Formula needs to ignore zero values.

  1. #1
    Registered User
    Join Date
    04-04-2015
    Location
    Bolton
    MS-Off Ver
    2013
    Posts
    7

    Cool Formula needs to ignore zero values.

    Hi Guys,

    I have an excel formula which I am using to return the sum of the last five entries in a column which gets data added to it over time. The entries are generated by another formula and are not hard values. The formula I use works perfectly for this but I need it to "ignore" results that are 0 and count the last 5 as being values greater than zero.

    Can anybody help?


    The formula I am using is: {=SUM(INDEX(B86:B124,LARGE(IF(B86:B124<>"",ROW(B86:B124)-ROW(B86)+1),3)):B124)}


    Thanks in advance!

  2. #2
    Registered User
    Join Date
    04-04-2015
    Location
    Bolton
    MS-Off Ver
    2013
    Posts
    7

    Re: Formula needs to ignore zero values.

    This formula also works but I have the same problem with not counting zero values:

    =SUM(OFFSET(B86,COUNTA(B86:B124)-5,0,7))

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula needs to ignore zero values.

    Try it like this

    =SUM(INDEX(B86:B124,LARGE(IF(B86:B124<>0,ROW(B86:B124)-ROW(B86)+1),5)):B124)

    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula needs to ignore zero values.

    Here's another one.

    Array entered**:

    =SUM(INDEX(B:B,N(IF(1,LARGE(IF(B86:B124>0,ROW(B86:B124)),{1,2,3,4,5})))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    04-04-2015
    Location
    Bolton
    MS-Off Ver
    2013
    Posts
    7

    Re: Formula needs to ignore zero values.

    Thanks Guys,

    Your the best both of these options work great!!!

    Much Love!

    Danny

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula needs to ignore zero values.

    You're welcome. We appreciate the feedback!

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Tweak IF formula to ignore some values
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-02-2013, 07:05 PM
  2. [SOLVED] Using an IF formula to ignore cells with certain values
    By JakeMann in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-14-2012, 07:57 AM
  3. Formula for Ignore Hide Values while making SUM ?
    By VICTOR5 in forum Excel General
    Replies: 3
    Last Post: 09-27-2011, 08:34 AM
  4. Replies: 5
    Last Post: 06-23-2010, 05:25 PM
  5. How do I ignore negative values in a formula
    By queestionable in forum Excel General
    Replies: 2
    Last Post: 08-16-2007, 10:26 AM

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