+ Reply to Thread
Results 1 to 9 of 9

Sum the difference in a range of cells if greater than zero

  1. #1
    Registered User
    Join Date
    05-19-2005
    Posts
    7

    Sum the difference in a range of cells if greater than zero

    Hi all,

    I've created a spreadsheet to track a guest list and RSVPs. I want to account for the four possible scenarios for RSVPs: #guests=#expected, #guests>#expected, #guests<#expected, and no RSVP has been returned.

    B C D E
    Expected Total Adults Kids
    6 6 2 4
    2 0
    2 3 2 1
    3 2 2 0
    2 1 1 0

    Column C=D+E
    I've applied conditional formatting so that cells in column B turn red if #guests<#expected using =$D5>0 and cells turn green if guests have replied that they are attending (regardless of the # of guests) using =AND(ISNUMBER($D5),$D5=0). Any guests who have not replied have column C blank.

    I want to calculate a comparison between how many guests were expected and how many are actually attending, based on the RSVPs received so far. In another cell, I can get =IF($D$5=0,"",$C$5-$B$5) to correctly display 0. In this short example, I would expect a sum of 3.
    How can I extend this formula over range $D$5:$D$300?

    Thanks much!
    Kristi

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sum the difference in a range of cells if greater than zero

    Hi Kristi,

    I believe it would be a simple sum of the ranges and then subtraction, see the attached file and let me know if this helps. thanks.
    guest tracker.xlsx

    regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    05-19-2005
    Posts
    7

    Re: Sum the difference in a range of cells if greater than zero

    Almost. But I want to include the number in column B in the sum only if the corresponding cell in column D is blank.

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sum the difference in a range of cells if greater than zero

    In that case the sum would be 2, see attached:-
    guest tracker.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    05-19-2005
    Posts
    7

    Re: Sum the difference in a range of cells if greater than zero

    Sorry, I posed it incorrectly. I want to include the number in column B in the sum only if the corresponding cell in column D is NOT blank

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sum the difference in a range of cells if greater than zero

    Ok.. just change the ="" to <>"" in the formula as shown below :-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached:- guest tracker.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Registered User
    Join Date
    05-19-2005
    Posts
    7

    Re: Sum the difference in a range of cells if greater than zero

    Got it to work - Thanks!!

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sum the difference in a range of cells if greater than zero

    Great..!!

    Request you to mark this thread as [SOLVED].. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Sum the difference in a range of cells if greater than zero

    @ krjacobs32

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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