+ Reply to Thread
Results 1 to 6 of 6

If condition with Count and Sum calculation ?

  1. #1
    Registered User
    Join Date
    08-22-2017
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    6

    If condition with Count and Sum calculation ?

    Hi Excel Guru,

    I need the below condition for attached screen short.

    If sales < 0 then count (# Transactions),sum(Sales) and sum(QTY)
    If sales >0 then count (# Transactions),sum(Sales) and sum(QTY)


    Country ID # Transactions Sales QTY
    14 2,685,075,440 -802.9 -10
    14 2,685,075,441 -665 -9
    15 2,685,075,442 -640 -3
    15 2,685,075,443 -636 -7
    15 2,685,075,444 620 10
    15 2,685,075,445 576 5
    30 2,685,075,446 528.8 6
    30 2,685,075,447 -519.18 -5
    30 2,685,075,448 -504 -7
    30 2,685,075,449 386.25 5
    30 2,685,075,450 -360 -6
    30 2,685,075,451 342.88 3
    44 2,685,075,452 -323.19 -6
    44 2,685,075,453 303.98 6
    44 2,685,075,454 -294.4 -3
    44 2,685,075,455 -293.1 -4
    44 2,685,075,456 290.4 4
    44 2,685,075,457 288.75 5
    44 2,685,075,458 287.3 3


    Please help me and thanks for you help.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,996

    Re: If condition with Count and Sum calculation ?

    What is in which cell??

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    08-22-2017
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    6

    Re: If condition with Count and Sum calculation ?

    Please find the attached excel for the same.

    Thanks for advance!!
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,996

    Re: If condition with Count and Sum calculation ?

    =COUNTIF(C:C,"<0")
    =SUMIF(C:C,"<0")
    =SUMIF(D:D,"<0")

    in E, F & G. Replace the < with > for the next 3 columns.

  5. #5
    Registered User
    Join Date
    08-22-2017
    Location
    INDIA
    MS-Off Ver
    2010
    Posts
    6

    Re: If condition with Count and Sum calculation ?

    Thanks Kennedy!, it is working correctly.

    One more question, how to use between condition in place of < or > ?

    example : if sales between 0.00 and 30.00 the count(transaction),sum(sales) and sum(qty).

    thanks in advance

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,996

    Re: If condition with Count and Sum calculation ?

    Like this, and similar:

    =COUNTIFS(C:C,">0",C:C,"<600")

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Formula Required to Count Rows only if condition is meet or else dont count
    By Shahbazk in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-22-2017, 08:39 AM
  2. Average calculation with condition
    By nagesh.tvsr in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-21-2017, 02:50 AM
  3. [SOLVED] Stop Calculation once a condition is met
    By stulesley in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-15-2017, 08:57 AM
  4. CL Calculation based on Condition
    By perpectuals in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-01-2017, 12:07 AM
  5. [SOLVED] How to count a condition based on having another condition?
    By Robster in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-12-2014, 04:17 PM
  6. Stop calculation once a condition is met
    By ryefield in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-01-2013, 07:30 PM
  7. STOP calculation after a condition has been met?
    By ryefield in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2013, 07:24 PM

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