+ Reply to Thread
Results 1 to 9 of 9

Counting text in multiple cells.

  1. #1
    Phil Jenkins
    Guest

    Counting text in multiple cells.

    Hi All,

    Here's my problem. I know a bit about formula's on excel but this one has
    got me stumped. For example: I have to different shops with many different
    locations. The locations are in different cells to the shops.

    Here's an Example
    Each line is classed as 1 incident
    ASDA Wigan
    ASDA Skelmersdale
    ALDI Wigan
    ALDI Skelmersdale

    I need to know how many occurences of asda wigan and aldi wigan. When i use
    the =countif formula it deducts the answer from the first sum and uses it for
    the second sum. I have hears of a way of entering a formula that tells me the
    answer. I think it was something to do with asking asda = 1 where
    skelmersdale occurs and asda = 1 where wigan occurs. Then the same for all
    the others.

    Please Help.

    Phil Jenkins

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    Assuming your data is in A1:B4 then,

    =SUMPRODUCT(OR(A1:A4="ALDI",A1:A4="ASDA")*(B1:C4="Wigan"))

    Does that help?

    Steve

  3. #3
    Bob Phillips
    Guest

    Re: Counting text in multiple cells.

    Why not just

    =COUNTIF(B:B,"Wigan")

    If the example data is only part and you don't want other stores in Wigan,
    use

    =SUMPRODUCT(--(ISNUMBER(MATCH(A1:A20,{"ASDA","ALDI"},0))),--(B1:B20="Wigan")
    )

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Phil Jenkins" <Phil Jenkins@discussions.microsoft.com> wrote in message
    news:5A5B3397-8C4E-41E7-AEC3-DF80331D67E9@microsoft.com...
    > Hi All,
    >
    > Here's my problem. I know a bit about formula's on excel but this one has
    > got me stumped. For example: I have to different shops with many different
    > locations. The locations are in different cells to the shops.
    >
    > Here's an Example
    > Each line is classed as 1 incident
    > ASDA Wigan
    > ASDA Skelmersdale
    > ALDI Wigan
    > ALDI Skelmersdale
    >
    > I need to know how many occurences of asda wigan and aldi wigan. When i

    use
    > the =countif formula it deducts the answer from the first sum and uses it

    for
    > the second sum. I have hears of a way of entering a formula that tells me

    the
    > answer. I think it was something to do with asking asda = 1 where
    > skelmersdale occurs and asda = 1 where wigan occurs. Then the same for all
    > the others.
    >
    > Please Help.
    >
    > Phil Jenkins




  4. #4
    Ron Coderre
    Guest

    RE: Counting text in multiple cells.

    Try something like this:

    With data in Col_A and Col_B

    C1: =SUMPRODUCT((A1:A10={"ASDA","ALDI"})*(B1:B10="WIGAN"))

    Adjust range references to suit your situation.

    Does that help?

    ***********
    Regards,
    Ron

    XL2002, WinXP-Pro


    "Phil Jenkins" wrote:

    > Hi All,
    >
    > Here's my problem. I know a bit about formula's on excel but this one has
    > got me stumped. For example: I have to different shops with many different
    > locations. The locations are in different cells to the shops.
    >
    > Here's an Example
    > Each line is classed as 1 incident
    > ASDA Wigan
    > ASDA Skelmersdale
    > ALDI Wigan
    > ALDI Skelmersdale
    >
    > I need to know how many occurences of asda wigan and aldi wigan. When i use
    > the =countif formula it deducts the answer from the first sum and uses it for
    > the second sum. I have hears of a way of entering a formula that tells me the
    > answer. I think it was something to do with asking asda = 1 where
    > skelmersdale occurs and asda = 1 where wigan occurs. Then the same for all
    > the others.
    >
    > Please Help.
    >
    > Phil Jenkins


  5. #5
    Duke Carey
    Guest

    RE: Counting text in multiple cells.

    to get the count of ASDA/Wigan and ALDI/Wigan use

    =SUMPRODUCT(--(A1:A100={"ASDA", "ALDI"})*(B1:B100="Wigan"))

    "Phil Jenkins" wrote:

    > Hi All,
    >
    > Here's my problem. I know a bit about formula's on excel but this one has
    > got me stumped. For example: I have to different shops with many different
    > locations. The locations are in different cells to the shops.
    >
    > Here's an Example
    > Each line is classed as 1 incident
    > ASDA Wigan
    > ASDA Skelmersdale
    > ALDI Wigan
    > ALDI Skelmersdale
    >
    > I need to know how many occurences of asda wigan and aldi wigan. When i use
    > the =countif formula it deducts the answer from the first sum and uses it for
    > the second sum. I have hears of a way of entering a formula that tells me the
    > answer. I think it was something to do with asking asda = 1 where
    > skelmersdale occurs and asda = 1 where wigan occurs. Then the same for all
    > the others.
    >
    > Please Help.
    >
    > Phil Jenkins


  6. #6
    Phil Jenkins
    Guest

    Re: Counting text in multiple cells.

    thats perfect, than you very much

    "Bob Phillips" wrote:

    > Why not just
    >
    > =COUNTIF(B:B,"Wigan")
    >
    > If the example data is only part and you don't want other stores in Wigan,
    > use
    >
    > =SUMPRODUCT(--(ISNUMBER(MATCH(A1:A20,{"ASDA","ALDI"},0))),--(B1:B20="Wigan")
    > )
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "Phil Jenkins" <Phil Jenkins@discussions.microsoft.com> wrote in message
    > news:5A5B3397-8C4E-41E7-AEC3-DF80331D67E9@microsoft.com...
    > > Hi All,
    > >
    > > Here's my problem. I know a bit about formula's on excel but this one has
    > > got me stumped. For example: I have to different shops with many different
    > > locations. The locations are in different cells to the shops.
    > >
    > > Here's an Example
    > > Each line is classed as 1 incident
    > > ASDA Wigan
    > > ASDA Skelmersdale
    > > ALDI Wigan
    > > ALDI Skelmersdale
    > >
    > > I need to know how many occurences of asda wigan and aldi wigan. When i

    > use
    > > the =countif formula it deducts the answer from the first sum and uses it

    > for
    > > the second sum. I have hears of a way of entering a formula that tells me

    > the
    > > answer. I think it was something to do with asking asda = 1 where
    > > skelmersdale occurs and asda = 1 where wigan occurs. Then the same for all
    > > the others.
    > >
    > > Please Help.
    > >
    > > Phil Jenkins

    >
    >
    >


  7. #7
    Phil Jenkins
    Guest

    RE: Counting text in multiple cells.

    thats perfect, than you very much

    "Duke Carey" wrote:

    > to get the count of ASDA/Wigan and ALDI/Wigan use
    >
    > =SUMPRODUCT(--(A1:A100={"ASDA", "ALDI"})*(B1:B100="Wigan"))
    >
    > "Phil Jenkins" wrote:
    >
    > > Hi All,
    > >
    > > Here's my problem. I know a bit about formula's on excel but this one has
    > > got me stumped. For example: I have to different shops with many different
    > > locations. The locations are in different cells to the shops.
    > >
    > > Here's an Example
    > > Each line is classed as 1 incident
    > > ASDA Wigan
    > > ASDA Skelmersdale
    > > ALDI Wigan
    > > ALDI Skelmersdale
    > >
    > > I need to know how many occurences of asda wigan and aldi wigan. When i use
    > > the =countif formula it deducts the answer from the first sum and uses it for
    > > the second sum. I have hears of a way of entering a formula that tells me the
    > > answer. I think it was something to do with asking asda = 1 where
    > > skelmersdale occurs and asda = 1 where wigan occurs. Then the same for all
    > > the others.
    > >
    > > Please Help.
    > >
    > > Phil Jenkins


  8. #8
    Phil Jenkins
    Guest

    RE: Counting text in multiple cells.

    thats perfect, than you very much

    "Ron Coderre" wrote:

    > Try something like this:
    >
    > With data in Col_A and Col_B
    >
    > C1: =SUMPRODUCT((A1:A10={"ASDA","ALDI"})*(B1:B10="WIGAN"))
    >
    > Adjust range references to suit your situation.
    >
    > Does that help?
    >
    > ***********
    > Regards,
    > Ron
    >
    > XL2002, WinXP-Pro
    >
    >
    > "Phil Jenkins" wrote:
    >
    > > Hi All,
    > >
    > > Here's my problem. I know a bit about formula's on excel but this one has
    > > got me stumped. For example: I have to different shops with many different
    > > locations. The locations are in different cells to the shops.
    > >
    > > Here's an Example
    > > Each line is classed as 1 incident
    > > ASDA Wigan
    > > ASDA Skelmersdale
    > > ALDI Wigan
    > > ALDI Skelmersdale
    > >
    > > I need to know how many occurences of asda wigan and aldi wigan. When i use
    > > the =countif formula it deducts the answer from the first sum and uses it for
    > > the second sum. I have hears of a way of entering a formula that tells me the
    > > answer. I think it was something to do with asking asda = 1 where
    > > skelmersdale occurs and asda = 1 where wigan occurs. Then the same for all
    > > the others.
    > >
    > > Please Help.
    > >
    > > Phil Jenkins


  9. #9
    Phil Jenkins
    Guest

    Re: Counting text in multiple cells.

    thats perfect, than you very much

    "SteveG" wrote:

    >
    > Assuming your data is in A1:B4 then,
    >
    > =SUMPRODUCT(OR(A1:A4="ALDI",A1:A4="ASDA")*(B1:C4="Wigan"))
    >
    > Does that help?
    >
    > Steve
    >
    >
    > --
    > SteveG
    > ------------------------------------------------------------------------
    > SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
    > View this thread: http://www.excelforum.com/showthread...hreadid=528540
    >
    >


+ 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