+ Reply to Thread
Results 1 to 7 of 7

Countif with one range to values added to give one total....

  1. #1
    Registered User
    Join Date
    08-08-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    3

    Countif with one range to values added to give one total....

    Hello

    I`m new here and need a little help

    currently trying to get countif to add two different values and give one total,
    I need this
    =COUNTIF(A3:AH3,"P")
    Plus
    =COUNTIF(A3:AH3,"P2")
    in one total, so it will add all the P's and P2's but P=1 and P2=2...

    so if i have 3 p's and 1 p2 the total should be 5.

    How can I do this ?

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,076

    Re: Countif with one range to values added to give one total....

    in the same cell
    =COUNTIF(A3:AH3,"P")+COUNTIF(A3:AH3,"P2")
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    08-08-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Countif with one range to values added to give one total....

    Quote Originally Posted by Special-K View Post
    in the same cell
    =COUNTIF(A3:AH3,"P")+COUNTIF(A3:AH3,"P2")
    I tried that but it just adds the P's and P2's.

    Imagine that P=1 and P2=2,
    I have 3x P and 1 x P2 = 5, but this just returns 4...

    Any ideas ? do I need Countif?

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Countif with one range to values added to give one total....

    Try

    =COUNTIF(A3:AH3,"P")+COUNTIF(A3:AH3,"P2")*2

  5. #5
    Registered User
    Join Date
    05-27-2012
    Location
    langkawi
    MS-Off Ver
    2007
    Posts
    46

    Re: Countif with one range to values added to give one total....

    Quote Originally Posted by Cutter View Post
    Try

    =COUNTIF(A3:AH3,"P")+COUNTIF(A3:AH3,"P2")*2
    cutter, that formula will give multiply of p2 if i not mistake

    so from info u give
    =COUNTIF(A3:AH3,"P")+COUNTIF(A3:AH3,"P2")*2[/QUOTE]
    = (3 of p)+((1 of p2)times 2)
    = 3+2
    = 5

    so is that the answer u expected?
    Last edited by alimamak; 08-08-2012 at 10:11 PM.

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Countif with one range to values added to give one total....

    I don't think that's what OP said.

    From post #3
    Imagine that P=1 and P2=2,
    I have 3x P and 1 x P2 = 5, but this just returns 4...
    P has a value of 1, P2 has a value of 2
    There are 3 P's and 1 P2 so that's
    =3 x 1 + 1 x 2
    =3 + 2
    =5

  7. #7
    Registered User
    Join Date
    08-08-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Countif with one range to values added to give one total....

    Quote Originally Posted by Cutter View Post
    Try

    =COUNTIF(A3:AH3,"P")+COUNTIF(A3:AH3,"P2")*2
    That worked...

    Quote Originally Posted by alimamak View Post
    cutter, that formula will give multiply of p2 if i not mistake

    so from info u give
    =COUNTIF(A3:AH3,"P")+COUNTIF(A3:AH3,"P2")*2
    Quote Originally Posted by alimamak View Post
    = (3 of p)+((1 of p2)times 2)
    = 3+2
    = 5

    so is that the answer u expected?
    Confused, as that gives the same result.
    Quote Originally Posted by Cutter View Post
    I don't think that's what OP said.

    From post #3

    P has a value of 1, P2 has a value of 2
    There are 3 P's and 1 P2 so that's
    =3 x 1 + 1 x 2
    =3 + 2
    =5
    Exactly, but it doesn't really matter because i got the result i needed.

    Now anyone know about percentages?

+ 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