+ Reply to Thread
Results 1 to 13 of 13

a more advanced countif?

Hybrid View

  1. #1
    Registered User
    Join Date
    05-23-2014
    Posts
    5

    a more advanced countif?

    Hello,

    So i want to count the individual responders in a separate table to tell how many have responded to a mailshot and come in and spent money - the table is mixed between sites, so below i have simplified it to 2 sites, Birmingham and London.

    So i want to count how many people from Birmingham have responded, so is there a way of looking a the site and matching the word "Birmingham" and then if true looking at spend to count how many are NOT blank. so the outcome should be "2" in the below table.

    If there is no figure in the "spend" column it means they haven't seen in yet so i don't want to count them.

    Site Name Spend

    Birmingham Dale £5.00
    London Bill £10.00
    london Trevor £15.00
    Birmingham Alan £8.00
    london Dave
    london Bob
    London Kate

    Thanks in advance!

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,797

    Re: a more advanced countif?

    Put the towns in a separate table assuming its say A2:B200 on sheet2
    and the data is in sheet1 Columns A and B

    now use
    =COUNTIFS( Sheet1!A2:A200, Sheet2!A2, Sheet1!B2:B200, ">0")
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: a more advanced countif?

    Which version of Excel do you use?
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Registered User
    Join Date
    05-23-2014
    Posts
    5

    Re: a more advanced countif?

    I'm using 2003 i'm afraid!! and sorry sktneer that didnt work

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: a more advanced countif?

    Quote Originally Posted by aaronp123 View Post
    I'm using 2003 i'm afraid!!
    You should update your profile. It may have prevented a page full of COUNTIFS suggestions

    try
    Formula: copy to clipboard
    =SUMPRODUCT(--(A1:A7="Birmingham"),--(C1:C7>0))

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: a more advanced countif?

    Not sure how do you want it to work. Try this to see if this is what you want?
    Assuming that your data is in the range A2:C8, Where column A has site names and column C has amounts.

    =COUNTIFS(A2:A8,"*Birmingham*",C2:C8,"<>")
    Change the formula as per your need.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: a more advanced countif?

    In that case you may try Sumproduct like this......

    =SUMPRODUCT(--(ISNUMBER(SEARCH("Birmingham",A2:A8))),--(C2:C8<>""))

  8. #8
    Registered User
    Join Date
    05-23-2014
    Posts
    5

    Re: a more advanced countif?

    when i try this i am getting #Value, should i be entering anything in place of isnumber or search?

  9. #9
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: a more advanced countif?

    Quote Originally Posted by aaronp123 View Post
    when i try this i am getting #Value, should i be entering anything in place of isnumber or search?
    The formula Assumes that your data (example in post#1) is in the range A2:C8 with row 1 as column header. Where Col. A has Sites, Col. B has Names and Col. C has amounts.
    If still you get the error, please upload a sample workbook by clicking on Go Advanced below the Quick Reply Box and finding the paper clip icon to upload the sample workbook by following simple instructions.

  10. #10
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: a more advanced countif?

    You can also try

    Formula: copy to clipboard

    =SUM((A1:A7="Birmingham")*(C1:C7<>""))


    This is an array formula so you would need to press CTRL + Shift + Enter instead of just Enter or Tab

    If you are going to be lax on capitalization as you were in the sample you provided it may help to use

    Formula: copy to clipboard

    =SUM((UPPER(A1:A7)="BIRMINGHAM")*(C1:C7<>""))


    edit: My formulas assume the same data layout as sktneer mentioned above.
    Last edited by Hawkeye16; 05-23-2014 at 06:17 AM.

  11. #11
    Registered User
    Join Date
    05-23-2014
    Posts
    5

    Re: a more advanced countif?

    excell help.xls

    I have attached the sheet simplified, Try and the total number of "aldershot" your last formula was close, when i changed >0 around to <0 it gave me a figure of 40, which counted every single entry, closer but not quite!

    Hope you can help.

  12. #12
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: a more advanced countif?

    So in your example file, use formula:
    Formula: copy to clipboard
    =SUMPRODUCT(--(A:A="Aldershot"),--(B:B>0))

  13. #13
    Registered User
    Join Date
    05-23-2014
    Posts
    5

    Re: a more advanced countif?

    That gave me a number error, but when i changed A:A to A2:A51 and B:B to B2:B51...It worked!!

    Thanks guys this has been bugging me for days!

+ 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. Need help combining advanced countif functions....
    By capy12 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-30-2013, 11:25 AM
  2. Advanced COUNTIF problem (maybe!)
    By kyjae in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-19-2013, 06:18 PM
  3. Advanced Excel COUNTIF/V/HLOOKUP FUNCTION
    By SalientAnimal in forum Excel General
    Replies: 3
    Last Post: 06-06-2012, 07:08 AM
  4. advanced countif with wildcard
    By polob12 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-31-2009, 12:04 PM
  5. advanced countif?
    By saybut in forum Excel General
    Replies: 4
    Last Post: 04-13-2005, 09:08 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