+ Reply to Thread
Results 1 to 10 of 10

Help with if and countif

  1. #1
    Registered User
    Join Date
    12-09-2012
    Location
    toronto
    MS-Off Ver
    Professional Plus 2021
    Posts
    31

    Help with if and countif

    Hi, I was wondering if someone could help me out. I looking for a formula that will count wins and loses for a particular sport. I've attached a sample of my spreadsheet.

    Ex. if B = NFL then F4 would count all the 'won' in column C and G4 would count all the 'Loss' in column C
    if B = NBA then F5 would count all the 'won' in column C and G5 would count all the 'Loss' in column C
    if B = NHL then F6 would count all the 'won' in column C and G6 would count all the 'Loss' in column C
    etc

    not sure if I explained my self correctly but any help would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Help with if and countif

    Try in F3 copied to the right and down...

    =SUMPRODUCT(--($B$2:$B$628=$E3),--($C$2:$C$628=F$2))

    ...a pivot table would also work well in this situation.
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    12-09-2012
    Location
    toronto
    MS-Off Ver
    Professional Plus 2021
    Posts
    31

    Re: Help with if and countif

    I paste that formula in F3? It gives me 12

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Help with if and countif

    What should you get?

    I got 22 for NFL and WON
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-09-2012
    Location
    toronto
    MS-Off Ver
    Professional Plus 2021
    Posts
    31

    Re: Help with if and countif

    Maybe I'm not using the formula correctly or didn't do a good job of explaining myself. I've attached another copy of the spreadsheet using only the first 10 lines of data as a sample with the results it should give me.
    Attached Files Attached Files

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Help with if and countif

    Then adjust the ranges...

    =SUMPRODUCT(--($B$2:$B$11=$E4),--($C$2:$C$11=F$3))

  7. #7
    Registered User
    Join Date
    12-09-2012
    Location
    toronto
    MS-Off Ver
    Professional Plus 2021
    Posts
    31

    Re: Help with if and countif

    Thanks so much, works perfect.

  8. #8
    Registered User
    Join Date
    12-10-2012
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2007
    Posts
    7

    Lightbulb Re: Help with if and countif

    COUNTIFS
    sample

    =COUNTIFS($B$2:$B$628,$E4,$C$2:$C$628,"WON")
    sample.jpg

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Help with if and countif

    Hi Ivan,

    If you notice, the OPs profile shows a version lower than 2007 so the COUNTIFS would not work.

  10. #10
    Registered User
    Join Date
    12-10-2012
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Help with if and countif

    Thanks Jeff, I could not see before that detail. Maybe someone with this situation in (Excel 2007) you could be of benefit. I'm new to the forum, and again thanks for your recommendation.


    Respectfully Ivan Sauri

+ 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