+ Reply to Thread
Results 1 to 4 of 4

sum negative and positive values seperately on a specific day

  1. #1
    Registered User
    Join Date
    06-08-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Lightbulb sum negative and positive values seperately on a specific day

    Hi,

    Please help me with this.
    I have a spreadsheet which looks like this. The dataset has been sorted by Customer ID.

    Date----------customer ID---------profit/(loss)
    01/01/11-------123-----------------------(30)
    02/01/11-------123------------------------10
    02/01/11-------123------------------------20
    02/01/11--------456----------------------(40)
    04/01/11-------456-----------------------30
    04/01/11--------567-----------------------(50)

    I want to aggrgate profits and losses seperately on a specific date. That is I need to arrange the above dataset in the following way.

    Date---------------Profit-----------------Loss
    01/01/11----------------------------------(30)
    02/01/11-----------30-------------------(40)
    04/01/11-----------30-------------------(50)

    Pls pls help me

    Thank you........

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: sum negative and positive values seperately on a specific day

    Use SUMPRODUCT

    First create your list of unique dates.

    Then for Profits use something like:

    =SUMPRODUCT(--('Sheet1'!$A$1:$A$100=A2),--('Sheet1'!$B$1:$B$100>0),'Sheet1'!$B$1:$B$100)

    =SUMPRODUCT(--('Sheet1'!$A$1:$A$100=A2),--('Sheet1'!$B$1:$B$100<0),'Sheet1'!$B$1:$B$100)

    Where Sheet1A1:B100 holds the database, And A2 on the current active sheet contains first unique date to check.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: sum negative and positive values seperately on a specific day

    Hi

    With date in E2:E4, Profit in F1 and Loss in G1
    enter the following in F2
    =SUMIFS($C$2:$C$7,$A$2:$A$7,$E2,$C$2:$C$7,">0")

    and in G2
    =SUMIFS($C$2:$C$7,$A$2:$A$7,$E2,$C$2:$C$7,"<0")

    Copy down as required

    ooops!!!
    Just noticed OP is using XL2003 so that won't work.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  4. #4
    Registered User
    Join Date
    06-08-2011
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: sum negative and positive values seperately on a specific day

    Thank both of you.... I will have a look and will let you know whether they work in my dataset....

+ 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