+ Reply to Thread
Results 1 to 7 of 7

Counting Formula

  1. #1
    Registered User
    Join Date
    05-03-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Counting Formula

    Hi everyone. I would be extremely grateful if someone could help me with a counting formula?

    In A1:A100 I have a list of locations (London, Sheffield, Leeds .... etc) - (non-unique)
    In B1:B100 I have a list of colours + numbers (Red 1, Blue 15, Green 22 .... etc) - (unique)

    In C1:C20 I have a unique list of the 20 locations.
    In D1:D20 I have a column that looks up the location in C1:C20 and counts how many rows contain that location in column A and the word “blue” in column B.

    Examples:
    D1 contains how many rows contain the location (looked up in C1) in column A AND the word “Blue” in column B.
    D2 contains how many rows contain the location (looked up in C2) in column A AND the word “Blue” in column B.

    Columns E, F, G .... etc would count the totals for the other colours.

    I have tried using COUNTIF, COUNT, SUMPRODUCT, Array Formulas (I still can’t get my head around array formulas!), but I just can’t seem to find anything that works.

    (I’m using “*blue*” as the search for the colour to exclude the numbers in the cell.)

    I THINK I have explained it OK.

    Many thanks in anticipation of anyone’s help.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Counting Formula help please.

    You indicate that you have Excel 2007, so:

    With a sheet set as you described...
    try this:
    Please Login or Register  to view this content.
    EDITED TO INCLUDE THIS EXCEL 2003 FORMULA:
    Please Login or Register  to view this content.
    Does that help?
    Last edited by Ron Coderre; 07-20-2010 at 05:25 PM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    05-03-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Counting Formula

    Hi Ron,

    Thank you so much for your quick reply. That does in fact work perfectly for me in 2007. Unfortunately (and I do apologize; I should have stated) it's for a 2003 sheet used at work.

    Thank you.

    Darrell.

  4. #4
    Registered User
    Join Date
    05-03-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Counting Formula

    Sorry Ron,

    JUST noticed the second formula. I'll try it and let you know.

    Thank you again in the meantime.

    Darrell.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Counting Formula

    If you list the locations in C2:C21 and the colours in D1:Z1 or similar then you can use this version of Ron's suggested formula in D2 copied across and down:

    =SUMPRODUCT(($A$1:$A$100=$C2)*(LEFT($B$1:$B$100,LEN(D$1))=D$1))
    Audere est facere

  6. #6
    Registered User
    Join Date
    05-03-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Counting Formula (Solved THANK YOU!)

    Hi Ron,

    Thank you so much, that second 2003 solution works absolutely perfectly.

    (Hopefully my headache might subside now!)

    Sincere thanks for your very kind help.

    Darrell.

  7. #7
    Registered User
    Join Date
    05-03-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Counting Formula

    Hi 'Daddylonglegs'

    Thank you too. I shall do that very thing.

    Thank you (both) again.

    Darrell.

+ 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