+ Reply to Thread
Results 1 to 4 of 4

I need to differentiate between 8 and 12 in count if formula

  1. #1
    Registered User
    Join Date
    11-26-2014
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    5

    I need to differentiate between 8 and 12 in count if formula

    I have been using a count if formula =COUNTIF(B36:AF36,"?")*12 to add up the hours worked each month.
    at the end of a row. In the spread sheet I use D for day shift and N for night shift "?" the *12 for 12 shifts.

    20 21 22 23 24 25 26 27 28 29 30 31 Hours
    W T F S S M T W T F S S Total W
    N N N N D D D D 96(=COUNTIF(B36:AF36,"?")*12)


    my shift pattern has now changed and I will be doing an 8 hour shift as well as normal 12 hour shifts.

    I would like to use E for eight hour shifts.

    I have tried to put an IF function in to differentiate between the E and the D,N . But am unable to
    get it to calculate properly. should I be using a different function for this?

    As you can probably tell I am new to functions can work with basics but would greatly appreciate some assistance with this

    thanks in advance Paul

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: I need to differentiate between 8 and 12 in count if formula

    How about

    =(COUNTIF(B36:AF36,"N")*12)+(COUNTIF(B36:AF36,"D")*12)+(COUNTIF(B36:AF36,"E")*8)

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: I need to differentiate between 8 and 12 in count if formula

    Here's another way to do that...

    =SUM(COUNTIF(B36:AF36,{"N","D","E"})*{12,12,8})
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    11-26-2014
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: I need to differentiate between 8 and 12 in count if formula

    Hi that was fantastic, so quick and fixed problem, thank you very much. Wonder why I seem to look for the complicated way of doing things.

+ 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. CAN WE Differentiate numbers in excel?
    By vengatvj in forum Excel General
    Replies: 35
    Last Post: 03-27-2014, 10:22 AM
  2. [SOLVED] sumif differentiate between 6.1 & 6.10
    By realnouns in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-19-2013, 01:17 PM
  3. Replies: 3
    Last Post: 01-01-2013, 09:44 AM
  4. Differentiate between 00 and 000
    By Prcntrygrl in forum Excel General
    Replies: 2
    Last Post: 01-19-2011, 07:06 PM
  5. Replies: 6
    Last Post: 09-16-2010, 05:19 AM

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