+ Reply to Thread
Results 1 to 7 of 7

Countifs statement help

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Countifs statement help

    I'm having trouble with a formula here is what I am trying to do.

    If cell A14 equals volkswagen and Cell I14 equals a date within the set date range then Cell J8 will count a whole number
    If cell A14 equals volkswagen and Cell I14 equals a date within the set date range and Cell P14 has any text value entered then Cell J8 will count a half (0.5) number
    Current formula in Cell J8 is below
    Please Login or Register  to view this content.
    Based on the image I have attached the following should be the value in cell J8 2.5

    I have attached an example workbook to reference

    1.PNG
    Example_workbook.xlsx

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Countifs statement help

    Alaskan

    Your formula is multiplying the two elements ("*"), not adding them.

    This change will give you 2.5:

    =(COUNTIFS($A$12:$A$176,I8,$K$12:$K$176,"YES")+0.5)+COUNTIFS($A$12:$A$176,I8,$K$12:$K$176,"<>YES",$P$12:$P$176,"<>")
    Last edited by Ochimus; 03-05-2016 at 08:35 PM.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Countifs statement help

    PNG images don't show up on the forum, JPEG images do, but workbooks are preferred.

    Where is the set date range? You need 2 additional criteria for each countifs function, ($I$14:$I$178,">="&startdate,$I$14:$I$178,"<="&enddate)

    edit:- Not seeing where you're getting 2.5 from though, unless the new formula should include all values in column K, even those with no text in column P.
    Last edited by jason.b75; 03-05-2016 at 08:40 PM.

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Countifs statement help

    Quote Originally Posted by Ochimus View Post
    You're multiplying the two elements ("*"), not adding them.
    Really? Try evaluating the formula, it adds them together, but multiplies the second one by 0.5, counting the result as half.

    Your formula simply adds half to the total regardless of the original result.

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Countifs statement help

    Quote Originally Posted by jason.b75 View Post
    PNG images don't show up on the forum, JPEG images do, but workbooks are preferred.

    Where is the set date range? You need 2 additional criteria for each countifs function, ($I$14:$I$178,">="&startdate,$I$14:$I$178,"<="&enddate)

    edit:- Not seeing where you're getting 2.5 from though, unless the new formula should include all values in column K, even those with no text in column P.
    There is a workbook attached and I have not had a problem in the past with .PNG showing up.

    As for the counting

    I have 3 values in the following cells
    A12
    A13
    A14

    I have 3 dates in Cells
    I12
    I13
    I14

    The cell P12 has text indicating that it is a split deal between myself and the other person
    Cell P13 and P14 have no text indicating it will be a whole number and is not a split so thus for I have set a total of 2.5 appointments

    I don't care how I get there or if there is a requirement within a date range I just need to numbers to add up properly.

    Pretty much if Cell A12 = Volkswagen and Cell I12 has a date in it then cell J8 =1
    If cell A13 = Volkswagen and Cell I13 has a date in it then cell J8 now =2

    the total should now be 2

    If cell A14 = Volkswagen and Cell I14 has a date in it and if Cell P14 has a text value in it then cell J8 =.5

    the total in cell J8 should now be 2.5

    The formula that I referenced above is the one in place right now that someone gave me and I just tested it and it is not doing what I wanted it to do.

  6. #6
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Countifs statement help

    The person posting a PNG image can see it because the original is on their computer, a few other people might be able to see it, if there browser is compatible, but the majority can't.

    There are many ways to get the correct result, counting all rows with Volkswagen and a date, then subtracting half of the text count from column P is one of them.

    =COUNTIFS($A$12:$A$176,I8,$I$12:$I$176,">0")-0.5*COUNTIFS($A$12:$A$176,I8,$I$12:$I$176,">0",$P$12:$P$176,"<>")

  7. #7
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Countifs statement help

    That is the exact formula that I was looking for. Thanks for the heads up on the .png I will start saving them in .jpeg

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Or within Countifs statement
    By blens1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2014, 10:22 PM
  2. [SOLVED] help nesting OR statement into COUNTIFS statement
    By HeyInKy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-18-2014, 09:31 AM
  3. [SOLVED] =COUNTIFS statement
    By Glen- in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-09-2014, 10:49 AM
  4. [SOLVED] Problem in COUNTIFS statement
    By abduljaleel.mca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2013, 02:32 AM
  5. [SOLVED] Countifs with selective if statement
    By Mulveriser in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-09-2013, 09:58 PM
  6. Expanding a Countifs statement
    By Icehockey44 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-24-2013, 07:23 AM
  7. Countifs Statement
    By turpink in forum Excel General
    Replies: 1
    Last Post: 09-12-2011, 01:01 PM

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