+ Reply to Thread
Results 1 to 14 of 14

countif formula with two data sources

  1. #1
    Registered User
    Join Date
    11-05-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    5

    countif formula with two data sources

    Hi

    I'm really sorry but Excel isn't my strong point. I've been trying to workout how to create a countif formula.

    I have two data sources, in column B I have the options Adult/Child and in Column C I have the option of Yes/No. I need a formula to count all the Adults that have responded Ys and then another formula for all the Child which have responded Yes.

    I appreciate this is probably so simple but my brain is fried with wedding planning :-(

    Thank you.
    Last edited by Pepe Le Mokko; 11-05-2019 at 11:54 AM. Reason: Title adapted. We know you are here for help

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Please help me with a countif formula

    Hi and welcome
    Pleaser read the yellow banner and add a sheet accordingly. Thanks

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: Please help me with a countif formula

    Administrative note
    Please update your profile as necessary to properly reflect the exact version(s) of Excel your question relates to. Members tailor answers based on your Excel version. Your profile does not indicate your version as Windows 10 is not an XL version
    Thanks

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,822

    Re: countif formula with two data sources

    Set up a little table, say in column E, with Adult in E2 and Child in E3. Then put Yes in F1 and No in G1, and then you can put this formula in F2:

    =COUNTIFS($B:$B,$E2,$C:$C,F$1)

    Copy this across into G2, then copy F2:G2 into F3:G3, and then you will have a summary table of all counts.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    11-05-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    5

    Re: countif formula with two data sources

    I'm so sorry I can't even do this forum correctly. I think I've just uploaded the spread sheet.

    Pete - I tried the formula but it didn't work. My cells for Adult/Child are from B5:B110 and I have the word Adult is U1 and the word Child in U2. Then I have the Yes/No is C5:C110 and the word Yes in V1 and No in V2.

    I'm sorry this is hard work. Completely my fault!
    Attached Files Attached Files

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: countif formula with two data sources

    Please read post #3 and refresh your memory about forum rules. Thanks

  7. #7
    Registered User
    Join Date
    11-05-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    5

    Re: countif formula with two data sources

    I don't know how to find out which version I'm using. Is there an easy way to find out please?

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: countif formula with two data sources

    Under the "File" tab - Help ?

  9. #9
    Registered User
    Join Date
    11-05-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    5

    Re: countif formula with two data sources

    It's Microsoft Office 365

  10. #10
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: countif formula with two data sources

    OK, so, update your profile accordingly. Thanks

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,822

    Re: countif formula with two data sources

    Put No in W1 (i.e. to the right of Yes), and put Adult in U2 and Child in U3, so that cell U1 is empty.

    Then you can use this formula in cell V2:

    =COUNTIFS($B:$B,$U2,$C:$C,V$1)

    Copy across and down as required, You should get your results like this (it might not line up exactly right):

    ……...…….Yes ….. No
    Adult …. 33 …... 0
    Child …… 11 ….. 1

    Hope this helps.

    Pete

  12. #12
    Registered User
    Join Date
    11-05-2019
    Location
    Kuala Lumpur
    MS-Off Ver
    365
    Posts
    3

    Re: countif formula with two data sources

    put this into cell f9 COUNTIFS($C$5:$C$109,$V$1,$B$5:$B$109,$U1) and copy to f10, btw your excel skills aren't so bad as you are using dropdown validation boxes!

    you should get 33 adults and 11 kids. enjoy your wedding day.

  13. #13
    Registered User
    Join Date
    11-05-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    5

    Re: countif formula with two data sources

    Pete thank you so much!!! This has saved me so much time. Thank you thank you!!!!!!

  14. #14
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,822

    Re: countif formula with two data sources

    You're welcome.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    You might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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. [SOLVED] COUNTIF formula where part of the range reference needs to use the result of a formula
    By zookeepertx in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 11-09-2018, 05:39 PM
  2. Adding a COUNTIF function to an existing IF AND COUNTIF Formula...
    By Ourkid123uk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-24-2018, 10:09 AM
  3. CountIf formula results in the formula itself being displayed.
    By NewKid in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-19-2017, 03:31 PM
  4. Assistance with CountIF formula and additional formula conditions
    By solios in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-18-2016, 01:46 PM
  5. Faster if/countif formula for flagging uniques - countif too slow
    By Speshul in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-19-2015, 01:44 PM
  6. [SOLVED] =Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]
    By thomas.mapua in forum Excel General
    Replies: 5
    Last Post: 01-06-2012, 11:33 AM
  7. Adding a CountIF to a formula that is already Countif
    By Cmorgan in forum Excel General
    Replies: 4
    Last Post: 06-01-2011, 09:34 AM

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