+ Reply to Thread
Results 1 to 10 of 10

How do i get a COUNTIF formula to sum totals?

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    London
    MS-Off Ver
    365
    Posts
    71

    How do i get a COUNTIF formula to sum totals?

    Hiya, I am trying to get a COUNTIF formula to work,and clearly I have done something wrong, although I can't see for looking what it is!

    I was hoping someone might be able to help me correct my current formula, which I have attached in a sample of my spreadsheet.

    Thanks for looking and for any advice you can give me.

    Kate :-)
    Attached Files Attached Files
    Last edited by necht_angel; 03-13-2012 at 04:01 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How do i get a COUNTIF formula to sum totals?

    necht_angel,

    Why not just sum column H?
    =SUM(H3:H6)

    If you don't want to sum negative values:
    =SUMIF(H3:H6,">0",H3:H6)
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do i get a COUNTIF formula to sum totals?

    Necht_Angel,

    Can you please mention whats the expected answer for this scenario?
    if I have understood you correctly then please try this.

    PHP Code: 
    =SUMPRODUCT(--(A3:F6>0)) 
    e4excel

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

    Re: How do i get a COUNTIF formula to sum totals?

    You mean SUMIFS?

    e.g.

    =SUMIFS(H3:H6,G3:G6,"*")

    with one criteria.. SUMIF...

    =SUMIF(G3:G6,"*",H3:H6)
    Last edited by NBVC; 03-13-2012 at 02:57 PM. Reason: added SuMif option
    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.

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: How do i get a COUNTIF formula to sum totals?

    use this formula instead

    =SUMIF(H3:H6,">0",H3:H6)
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  6. #6
    Registered User
    Join Date
    09-21-2011
    Location
    London
    MS-Off Ver
    365
    Posts
    71

    Re: How do i get a COUNTIF formula to sum totals?

    My apologies, I haven't been clear. I only want to sum the totals in column H if there is text in column G, but if the text in column G is a 0 (it can be something else if a zero wont work) , then I don't want the adjacent figure of that row in column H included in the sum... does make any sense?

    I have updated the worksheet to show what I mean a bit clearer ( i hope lol)

    Thanks for all your input

    Kate
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How do i get a COUNTIF formula to sum totals?

    =sumif(g3:g6,"<>0",h3:h6)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  8. #8
    Registered User
    Join Date
    09-21-2011
    Location
    London
    MS-Off Ver
    365
    Posts
    71

    Re: How do i get a COUNTIF formula to sum totals?

    Thanks Special-K, that seems to have done the trick.

    Kate :-)

  9. #9
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: How do i get a COUNTIF formula to sum totals?

    I dont know whether you would take a look as the Thread is marked SOLVED but couldn't resist myself..

    PHP Code: 
    =SUMPRODUCT(--(A3:F6>0)*(G3:G6<>0)) 
    By using the above formula you are not relying on the totals in the column H at all...


    If you liked my solution, please click on the Star
    Last edited by e4excel; 03-13-2012 at 04:15 PM.

  10. #10
    Registered User
    Join Date
    09-21-2011
    Location
    London
    MS-Off Ver
    365
    Posts
    71

    Re: How do i get a COUNTIF formula to sum totals?

    Thanks e4excel, also works :-)

+ 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