+ Reply to Thread
Results 1 to 7 of 7

count conditional days - ajit

Hybrid View

  1. #1
    Ajit Munj
    Guest

    count conditional days - ajit

    I have created data as below:
    A B C D E F
    Sun Mon Tue Wed Thu Fri Sat....
    1 2 3 4 5 6 7 .....31
    Jack P P A P A P A P

    I want to calculate how many Sundays, Tuesdays etc. Jack
    was present and absent? How can I do this? (P=Present
    A=absent)
    Ajit
    --
    Knowldege is Power

  2. #2
    Bob Phillips
    Guest

    Re: count conditional days - ajit

    =SUMPRODUCT(--(A3:A10="Jack"),--(OFFSET(A3:A10,,1)="P"))

    Change the name to suit, the A/P to suit, and the ,,1 to reflect the day

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Ajit Munj" <ajitmunj@microsoft.com> wrote in message
    news:B656A0B2-8083-45FF-89A3-EB41B21BD54F@microsoft.com...
    > I have created data as below:
    > A B C D E F
    > Sun Mon Tue Wed Thu Fri Sat....
    > 1 2 3 4 5 6 7 .....31
    > Jack P P A P A P A P
    >
    > I want to calculate how many Sundays, Tuesdays etc. Jack
    > was present and absent? How can I do this? (P=Present
    > A=absent)
    > Ajit
    > --
    > Knowldege is Power




  3. #3
    Peter Rooney
    Guest

    Re: count conditional days - ajit

    Bob,

    Think I'm missing something here - what's the "A/P"?

    Pete Rooney



    "Bob Phillips" wrote:

    > =SUMPRODUCT(--(A3:A10="Jack"),--(OFFSET(A3:A10,,1)="P"))
    >
    > Change the name to suit, the A/P to suit, and the ,,1 to reflect the day
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Ajit Munj" <ajitmunj@microsoft.com> wrote in message
    > news:B656A0B2-8083-45FF-89A3-EB41B21BD54F@microsoft.com...
    > > I have created data as below:
    > > A B C D E F
    > > Sun Mon Tue Wed Thu Fri Sat....
    > > 1 2 3 4 5 6 7 .....31
    > > Jack P P A P A P A P
    > >
    > > I want to calculate how many Sundays, Tuesdays etc. Jack
    > > was present and absent? How can I do this? (P=Present
    > > A=absent)
    > > Ajit
    > > --
    > > Knowldege is Power

    >
    >
    >


  4. #4
    Peter Rooney
    Guest

    Re: count conditional days - ajit

    Bob,
    Ever wished the earth could open up and swallow you? "Absent/Presnt" - Doh!
    Sorry to hijack this string with abject stupidity.

    Pete



    "Peter Rooney" wrote:

    > Bob,
    >
    > Think I'm missing something here - what's the "A/P"?
    >
    > Pete Rooney
    >
    >
    >
    > "Bob Phillips" wrote:
    >
    > > =SUMPRODUCT(--(A3:A10="Jack"),--(OFFSET(A3:A10,,1)="P"))
    > >
    > > Change the name to suit, the A/P to suit, and the ,,1 to reflect the day
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Ajit Munj" <ajitmunj@microsoft.com> wrote in message
    > > news:B656A0B2-8083-45FF-89A3-EB41B21BD54F@microsoft.com...
    > > > I have created data as below:
    > > > A B C D E F
    > > > Sun Mon Tue Wed Thu Fri Sat....
    > > > 1 2 3 4 5 6 7 .....31
    > > > Jack P P A P A P A P
    > > >
    > > > I want to calculate how many Sundays, Tuesdays etc. Jack
    > > > was present and absent? How can I do this? (P=Present
    > > > A=absent)
    > > > Ajit
    > > > --
    > > > Knowldege is Power

    > >
    > >
    > >


  5. #5
    Ajit Munj
    Guest

    Re: count conditional days - ajit

    Thanks Bob,want some explanations
    1. what is the use of "--" in formula?
    2. What is offset function? Help on this functions is not available
    with my excel version.
    3. This query is not related with the given formula. How can I
    use "and", "or" expression as it is used in dbase or foxpro (e.g.
    if
    (this conditions is true) .and.
    (that conditions is true)
    then
    (do this)
    ..or.(do this)

    "Bob Phillips" wrote:

    > =SUMPRODUCT(--(A3:A10="Jack"),--(OFFSET(A3:A10,,1)="P"))
    >
    > Change the name to suit, the A/P to suit, and the ,,1 to reflect the day
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Ajit Munj" <ajitmunj@microsoft.com> wrote in message
    > news:B656A0B2-8083-45FF-89A3-EB41B21BD54F@microsoft.com...
    > > I have created data as below:
    > > A B C D E F
    > > Sun Mon Tue Wed Thu Fri Sat....
    > > 1 2 3 4 5 6 7 .....31
    > > Jack P P A P A P A P
    > >
    > > I want to calculate how many Sundays, Tuesdays etc. Jack
    > > was present and absent? How can I do this? (P=Present
    > > A=absent)
    > > Ajit
    > > --
    > > Knowldege is Power

    >
    >
    >


  6. #6
    Bob Phillips
    Guest

    Re: count conditional days - ajit



    "Ajit Munj" <ajitmunj@microsoft.com> wrote in message
    news:D2FD7372-E698-4F6C-B3AB-887D66550B0B@microsoft.com...
    > Thanks Bob,want some explanations
    > 1. what is the use of "--" in formula?


    Take a look at http://www.xldynamic.com/source/xld.SUMPRODUCT.html

    > 2. What is offset function? Help on this functions is not available
    > with my excel version.


    The OFFSET is used to get a row or column displaced from the source. In this
    case, as you sometimes want to count Sun totals, sometimes Mon, etc, I am
    using the OFFSET to dynamically get that day amount, OFFSET from column A.
    So on Sun (1), it gets column B amounts it gets column C amounts, etc.

    > 3. This query is not related with the given formula. How can I
    > use "and", "or" expression as it is used in dbase or foxpro (e.g.
    > if
    > (this conditions is true) .and.
    > (that conditions is true)
    > then
    > (do this)
    > .or.(do this)


    You can't. SUMPRODUCT is an Excel formula, and this usage is peculiar to
    Excel. Each conditional test is effectively an AND condition.

    > Bob Phillips" wrote:
    >
    > > =SUMPRODUCT(--(A3:A10="Jack"),--(OFFSET(A3:A10,,1)="P"))
    > >
    > > Change the name to suit, the A/P to suit, and the ,,1 to reflect the day
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Ajit Munj" <ajitmunj@microsoft.com> wrote in message
    > > news:B656A0B2-8083-45FF-89A3-EB41B21BD54F@microsoft.com...
    > > > I have created data as below:
    > > > A B C D E F
    > > > Sun Mon Tue Wed Thu Fri Sat....
    > > > 1 2 3 4 5 6 7 .....31
    > > > Jack P P A P A P A P
    > > >
    > > > I want to calculate how many Sundays, Tuesdays etc. Jack
    > > > was present and absent? How can I do this? (P=Present
    > > > A=absent)
    > > > Ajit
    > > > --
    > > > Knowldege is Power

    > >
    > >
    > >




  7. #7
    Jason Morin
    Guest

    Re: count conditional days - ajit

    With the days in row 1 and P/A in row 3, try:

    =SUMPRODUCT(--(1:1="Sun"),--(3:3="P"))

    Duplicate the formula for rest of the days, and then
    repeat for "A".

    HTH
    Jason
    Atlanta, GA

    >-----Original Message-----
    >I have created data as below:
    > A B C D E F
    > Sun Mon Tue Wed Thu Fri Sat....
    > 1 2 3 4 5 6 7 .....31
    >Jack P P A P A P A P
    >
    >I want to calculate how many Sundays, Tuesdays etc. Jack
    >was present and absent? How can I do this? (P=Present
    >A=absent)
    >Ajit
    >--
    >Knowldege is Power
    >.
    >


+ 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