+ Reply to Thread
Results 1 to 9 of 9

Countifs problem

  1. #1
    Registered User
    Join Date
    03-27-2018
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Countifs problem

    Hi,
    I've not really used much excel for the past 10 years - used to be quite good with it but as the old saying goes - "use it or lose it". Anyway, hopefully somebody here can help


    21/03/18 22/03/18 23/03/18 24/03/18 25/03/18 26/03/18 27/03/18 28/03/18 No of days (What i need to get out of excel)

    Andy FIA D D D D D D FOP 7
    Barnie FIP D D D D 4
    Charlie D D D D D FOA 5
    Dexter DIA D DOP DIP D 3


    Start Date End Date
    21/03/18 27/03/18

    So basically I have a roster and want to count for each person (No of days column) the number of days they have worked in a given time period (start/end date)- need the FIA/FIP/DIA/DIP/D codes but not FOA or FOP

    I got as far as using a countif statement to count the FIA + D etc... for an entire row but can't work out how to limit it to the date range
    =(COUNTIF(I10:XFD10,"FIA")+COUNTIF(I10:XFD10,"FIP")+COUNTIF(I10:XFD10,"DIA")+COUNTIF(I10:XFD10,"DIP")+COUNTIF(I10:XFD10,"D"))



    Hopefully this makes sense to someone, would really appreciate some help. Thanks.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Countifs problem

    You probably need COUNTIFS, not COUNTIF.

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Countifs problem

    You'll be better attaching a sample workbook with what you are trying to achieve.

    Go Advanced -> Manage Attachments -> Upload

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Countifs problem

    Try


    J2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Copy down






    Excel 2016 (Windows) 64 bit
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    1
    21.03.2018
    22.03.2018
    23.03.2018
    24.03.2018
    25.03.2018
    26.03.2018
    27.03.2018
    28.03.2018
    Result
    2
    Andy FIA D D D D D D FOP
    7
    3
    Barnie FIP D D D D
    5
    4
    Charlie D D D D D FOA
    5
    5
    Dexter DIA D DOP DIP D
    4
    6
    7
    Start Date End Date
    8
    21.03.2018
    27.03.2018
    Sheet: Sheet1
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Registered User
    Join Date
    03-27-2018
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: Countifs problem

    Thanks for all the quick replies.
    shukla.ankur281190 that's exactly what I'm after. I've applied the formula to my spreadsheet but it's giving me the #value error. Does the date have to be in written in a specific way for it work?

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Countifs problem

    No need any specific date, system date is sufficient. # Value error means Incorrent Data Types. Press Alt-T-U-F and slowly press enter and see when error come? If you found when error come you can speak me or if you are unable to do process attach the sample spreadsheet for examine why it is happening

  7. #7
    Registered User
    Join Date
    03-27-2018
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: Countifs problem

    Hey Shukla,
    Have attached as I still can't figure it out sorry.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    07-06-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Countifs problem

    Change the last part of the formula. Your range did not tally so it is showing error. Change G6:XFD6 to G6:GCK6.
    Last edited by finalazy; 03-27-2018 at 02:53 AM.

  9. #9
    Registered User
    Join Date
    03-27-2018
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    9

    Re: Countifs problem

    Thanks for you help Shukla and Finalazy - works perfectly now. Rep added.

+ 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. [SOLVED] Countifs problem
    By kesh123 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-18-2018, 03:57 PM
  2. Countifs problem
    By tsetsko94 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2017, 06:20 AM
  3. Countifs problem
    By ryanmorano in forum Excel General
    Replies: 7
    Last Post: 05-16-2017, 11:19 AM
  4. [SOLVED] countifs problem
    By sjpras in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-02-2015, 02:53 AM
  5. [SOLVED] Problem with COUNTIFS
    By jrlafrance in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2013, 02:59 PM
  6. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  7. COUNTIFS problem
    By javajoemorgan in forum Excel General
    Replies: 8
    Last Post: 10-15-2009, 11:28 AM

Tags for this Thread

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