+ Reply to Thread
Results 1 to 22 of 22

Count specific value if another cell is populated

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Nottingham
    MS-Off Ver
    Excel 365
    Posts
    61

    Count specific value if another cell is populated

    Hiya,

    So I need a formula that will count the amount of a specific word IF that word also has a value in a particular cell

    So for example I have a list of locations in column B and I want to search for say Nottingham but I only want it to return a value IF that row that contains Nottingham also has a value in cell G.

    B G

    1 Nottingham Populated cell
    2 Nottingham Blank cell
    3 Birmingham Populated cell

    So above would count only 1 as only one cell contains Nottingham and a value in G.

    I apologise if I haven't worded this right, but I am sure it is an IF/AND formula I just can't work it out. I have got this so far:

    =COUNTIF('May 13'!B9:B282,A3)

    A3 contains the word Nottingham, so where do I put to only count IF G is also populated?

    Thank you in advance.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Count specific value if another cell is populated

    I think you need the sumif formula

    Please Login or Register  to view this content.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count specific value if another cell is populated

    Perhaps.

    =SUMPRODUCT(('May 13'!B9:B282=A3)*('May 13'!G9:G282<>""))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    02-06-2013
    Location
    Nottingham
    MS-Off Ver
    Excel 365
    Posts
    61

    Re: Count specific value if another cell is populated

    Hiya both,

    Fotis your's worked a treat. Thank you very much, greatly appreciated.

    Oeldere your's returned a value of 0 when it should have returned 12, but thank you for your effort it is really appreciated :-)

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count specific value if another cell is populated

    ........................

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Count specific value if another cell is populated

    @Ju1cy

    Thanks for the reply.

    I'm supprised my solution give the answer 0, and fortis1991 gives you the result 12.

    I think (seeing the formula's) that both formula's should give the same result.

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count specific value if another cell is populated

    @ Oeldere

    My friend. Op wants to count using 1 criterion.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Count specific value if another cell is populated

    @Fortis1991

    Thank you very much, for pointing me in the right direction

    Still don't get it the OP gets the result 0 in my solution (since the data are <>0), otherwise your formula would also be 0.

  9. #9
    Registered User
    Join Date
    02-06-2013
    Location
    Nottingham
    MS-Off Ver
    Excel 365
    Posts
    61

    Re: Count specific value if another cell is populated

    Hi all,

    Got a tricky twist to this one.

    One column that I will be referring to for the counting of has numbers in and I need those numbers adding up in the count, so for example:

    =SUMPRODUCT(('Jan 13'!$B$7:$B$500=A7)*('Jan 13'!$J$7:$N$500<>""))

    Between J7 to N500 the items have any combination of 1 - 5 entered in some of the cells and instead of just counting how many cells have contents I need the values of those contents also adding up.

    is this possible?

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count specific value if another cell is populated

    Do you mean?

    =SUMPRODUCT(('Jan 13'!$B$7:$B$500=A7)*('Jan 13'!$J$7:$N$500<>"")*('Jan 13'!$J$7:$N$500))

  11. #11
    Registered User
    Join Date
    02-06-2013
    Location
    Nottingham
    MS-Off Ver
    Excel 365
    Posts
    61

    Re: Count specific value if another cell is populated

    Hi Fotis,

    Absolutely amazing!! Thank you very much :-) I hope to one day know how to do this...it's very impressive.

    Thank you again.

  12. #12
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count specific value if another cell is populated

    Thank you for your good words!

    You will do! Just you need some practice!

  13. #13
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count specific value if another cell is populated

    Duplicate post. Forum has problems again...
    Last edited by Fotis1991; 07-03-2013 at 08:38 AM.

  14. #14
    Registered User
    Join Date
    02-06-2013
    Location
    Nottingham
    MS-Off Ver
    Excel 365
    Posts
    61

    Re: Count specific value if another cell is populated

    Oh getting frustrated now lol.

    The formula you said works in my test sheet but on my actual spreadsheet, the page is in another file so I have edited the formula to fit but it returns #VALUE! can you see why at all?

    =SUMPRODUCT(('[Medical Loan database 2013.xls]Jan 13'!$B$7:$B$500=A6)*('[Medical Loan database 2013.xls]Jan 13'!$J$7:$N$500<>"")*('[Medical Loan database 2013.xls]Jan 13'!$J$7:$N$500))

  15. #15
    Registered User
    Join Date
    07-03-2013
    Location
    Antwerp, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Count specific value if another cell is populated

    Hi,

    I tried your formula out on a small sample table of my own and it seems to work fine.

  16. #16
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count specific value if another cell is populated

    Strange...! I don't see anything wrong! Does the formula for count works?

  17. #17
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Count specific value if another cell is populated

    Is there text in the range J7:N500?

    In that case you get the error #Value!

  18. #18
    Registered User
    Join Date
    07-03-2013
    Location
    Antwerp, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Count specific value if another cell is populated

    Hi,

    can you send me a small sample file where the formula does not work ?
    send it either to the forum
    Last edited by arlu1201; 07-03-2013 at 09:54 AM. Reason: Removed email to avoid spam.

  19. #19
    Registered User
    Join Date
    02-06-2013
    Location
    Nottingham
    MS-Off Ver
    Excel 365
    Posts
    61

    Re: Count specific value if another cell is populated

    Yeah I think there is a conflict within my existing spreadsheet, as I've done the formula in the actual sheet the data is in and it works fine so it's a little brain boggling but I can work round it.

    Thanks for your help though

  20. #20
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Count specific value if another cell is populated

    Nice to hear this!

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

    Re: Count specific value if another cell is populated

    J.Vangerven,

    For the benefit of all, files should be uploaded to the forum directly and not sent via email.
    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]

  22. #22
    Registered User
    Join Date
    02-06-2013
    Location
    Nottingham
    MS-Off Ver
    Excel 365
    Posts
    61

    Re: Count specific value if another cell is populated

    Hi J.Vangerven I would but it contains confidential information so I could modify it to remove the information but it rather large.

    I will use it as is, in fact I worked round it by getting it to work in the main data spreadsheet and just moved the sheet to the statistic spreadsheet and it worked which is even more confusing but I am not complaining as it's working.

    Many thanks to all who have helped with this

+ 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