+ Reply to Thread
Results 1 to 4 of 4

Counting problem

  1. #1
    Registered User
    Join Date
    10-29-2006
    Posts
    4

    Counting problem


    I have a (large) spreadsheet with, amongst many other columns, the following sort of information:

    ColB.....ColK.....Col L
    Colour...Status...Live
    -----------------------
    R........Closed.....Y
    A........Open.......Y
    G........Closed
    R........Open
    G........Open

    What I want is a formula that says:

    count all occurrences of R/A/G in Col B but then subtract from that result the number of those that also have either 'Closed' in Col K or 'Y' in Col L. If both Col K and Col L are true then still only subtract 1.

    In the above example, I would expect the results of the formula to be:

    R ..... 1
    A ..... 0
    G ..... 1

    Any help greatly appreciated, I'm getting tired now and it's getting late and my head is beginning to spin

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Would this work

    =SUMPRODUCT(--($B$2:$B$100="R")*(--($L$2:$L$100<>"Y")*(--($K$2:$K$100<>"Closed"))))

    =SUMPRODUCT(--($B$2:$B$100="A")*(--($L$2:$L$100<>"Y")*(--($K$2:$K$100<>"Closed"))))

    =SUMPRODUCT(--($B$2:$B$100="G")*(--($L$2:$L$100<>"Y")*(--($K$2:$K$100<>"Closed"))))

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    10-29-2006
    Posts
    4
    That's absolutely fantastic - exactly what I wanted, worked a treat.

    Many thanks - I can go to bed now

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No Problem

    Glad I could help

    VBA Noob

+ 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