+ Reply to Thread
Results 1 to 11 of 11

sum + count if based on 3 conditions

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    sum + count if based on 3 conditions

    Hello!

    I have a little issue here with my formula.

    I using the following formula to count how many entries I have in an indirect worksheet (B2) depending on if column A has a certain value (A6).
    =IF(ISBLANK($A6),"",COUNTIF((INDIRECT("'"&$B$2&"'!$A$20:$A$2000")),$A6))

    Now, what I would need is a way to count, depending on if the indirect worksheet has the specific value (A6) in column A of the indirect worksheet BUT then SUM up the figures from column M of the specific entry only.

    I have been playing around with this but am stuck now...
    =IF(ISBLANK($A6),"",COUNT(IF((INDIRECT("'"&$B$2&"'!$A$20:$A$2000"))=$A6,SUM((INDIRECT("'"&$B$2&"'!$M$20:$M$2000"))),"NA")))

    Any assistance would be appreciated.
    Thanks,
    A2k

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

    Re: sum + count if based on 3 conditions

    Would be easier to look at example workbook.

  3. #3
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: sum + count if based on 3 conditions

    Sample is attached.
    Thank you
    A2k
    Attached Files Attached Files

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: sum + count if based on 3 conditions

    Here, try this:

    =IF(A5="", "", SUMIF(INDIRECT("'"&$B$2&"'!$A$20:$A$2000"), A5, INDIRECT("'"&$B$2&"'!$M$20:$M$2000")))

  5. #5
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: sum + count if based on 3 conditions

    Works like a charm, thanks a lot!

    A2k

  6. #6
    Registered User
    Join Date
    05-16-2013
    Location
    India,Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: sum + count if based on 3 conditions

    I have data in the below format
    Name AccruedDate ExpiryDate Lapsed Date AccruedDate ExpiryDate Lapsed Date
    Anna 3rd Feb 2013 3rd Apr 2013 3rd Apr 2013 3rd Feb 2013 3rd Apr 2013 3rd Apr 2013
    Mary 4th Jan 2013 4th Apr 2013 5th Mar 2013 5th June 2013 5th June 2013

    I want the count of how many Anna and Mary has Arrued Leaves (2) which is under "Accrued Date" column and the same way I want count of hpw many Expired Leaves and how many Lapsed Leaves for all the employees

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: sum + count if based on 3 conditions

    sramakrishna,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  8. #8
    Registered User
    Join Date
    05-16-2013
    Location
    India,Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: sum + count if based on 3 conditions

    Hi Arlu,

    I am unable to get the option for New Thread and I am searching for it

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: sum + count if based on 3 conditions

    Please check the 1st point here - http://www.excelforum.com/faq.php

  10. #10
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Pune
    MS-Off Ver
    Office 365 (Win 10)
    Posts
    489

    Thumbs up Re: sum + count if based on 3 conditions

    Here is the option
    Snap1.jpg

  11. #11
    Registered User
    Join Date
    05-16-2013
    Location
    India,Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: sum + count if based on 3 conditions

    Hi Arul,

    Thanks. I have just posted a new thread named "Countrowvalues-Header"

+ 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