+ Reply to Thread
Results 1 to 9 of 9

COUNT Functions

  1. #1
    Registered User
    Join Date
    09-21-2022
    Location
    Hastings, UK
    MS-Off Ver
    2019
    Posts
    7

    COUNT Functions

    Hi,

    So I have a spreadsheet that covers a years worth of shifts. I've got a COUNTA formula that adds up the amount of weekends worked for each person that is as follows.

    =COUNTA(E5:E6,E12:E13,E19:E20,E26:E27,E33:E34,E40:E41,E47:E48,E54:E55,E61:E62,E68:E69,E75:E76,E82:E83,E89:E90,E96:E97,E103:E104,E110:E111,E117:E118,E124:E125,E131:E132,E138:E139,E145:E146,E152:E153,E159:E160,E166:E167,E173:E174,E180:E181,E187:E188,E194:E195,E201:E202,E208:E209,E215:E216,E222:E223,E229:E230,E236:E237,E243:E244,E250:E251,E257:E258,E264:E265,E271:E272,E278:E279,E285:E286,E292:E293,E299:E300,E306:E307,E313:E314,E320:E321,E327:E328,E334:E335,E341:E342,E348:E349,E355:E356,E362:E363)

    Probably not the ideal way to do this I know, but the problem is when someone types "Annual Leave", "A/L" or "N/A" it obviously adds it to the working weekend count. Is there a solution to negate this?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,731

    Re: COUNT Functions

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: COUNT Functions

    Note: This function does exactly the same as your COUNTA function:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Perhaps other formulas are possible in your sheet, but I would have to see these first.

    For your question, how do you prevent weekend days from being counted incorrectly, we need to see an example workbook.
    A rule must then be devised for Excel how to distinguish between a weekend day that is worked and a weekend day that is not worked.
    Last edited by HansDouwe; 07-20-2023 at 11:05 PM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,895

    Re: COUNT Functions

    Do the rows have labels? For instance, day names or dates?
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    09-21-2022
    Location
    Hastings, UK
    MS-Off Ver
    2019
    Posts
    7

    Re: COUNT Functions

    Sorry for the delayed response, I have attached small workbook as an example.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    10-22-2022
    Location
    Santa Cruz, Bolivia
    MS-Off Ver
    MSO 365
    Posts
    157

    Re: COUNT Functions

    hi there, after check the consult I allow to propose this possible solution to copy and drag to right from D35:

    Please Login or Register  to view this content.
    I hope it results useful.

  7. #7
    Registered User
    Join Date
    09-21-2022
    Location
    Hastings, UK
    MS-Off Ver
    2019
    Posts
    7

    Re: COUNT Functions

    Quote Originally Posted by HansDouwe View Post
    Note: This function does exactly the same as your COUNTA function:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Perhaps other formulas are possible in your sheet, but I would have to see these first.

    For your question, how do you prevent weekend days from being counted incorrectly, we need to see an example workbook.
    A rule must then be devised for Excel how to distinguish between a weekend day that is worked and a weekend day that is not worked.

    This worked really well, thank you.

    Now is there a way to differentiate that when I type 'N/A' or 'A/L' in the weekend boxes they don't add to the working weekend table. I have attached an example book. It currently has the old formula in there.

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: COUNT Functions

    Please try in D35 and copy to right:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: COUNT Functions

    Or try this:

    =SUMPRODUCT((WEEKDAY($C5:$C32,2)>5)*(D5:D32<>"")*(D5:D32<>"N/A")*((D5:D32<>"A/L")))

+ 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] IF and Count functions together
    By MTC2016 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-13-2018, 09:02 AM
  2. Count and if functions
    By romasasss in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 12-17-2013, 05:40 PM
  3. Count Functions
    By ryanry in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2012, 02:28 AM
  4. Using the COUNT Functions
    By ExcelTip in forum Tips and Tutorials
    Replies: 1
    Last Post: 01-18-2012, 04:36 PM
  5. Count If functions
    By Statz in forum Excel General
    Replies: 2
    Last Post: 03-26-2011, 04:08 PM
  6. Help with count functions
    By JChidester in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-31-2011, 04:44 PM
  7. Count if functions
    By pentatonic145 in forum Excel General
    Replies: 4
    Last Post: 07-12-2007, 03:58 PM

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