+ Reply to Thread
Results 1 to 19 of 19

Derive a formula without calculating multiple COUNTIFS

  1. #1
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Derive a formula without calculating multiple COUNTIFS

    <edited to fix a mistake for days in Feb!>


    Hi, id like to keep count on the days i work from home (WFH) and work from office (WFO) for the year. We're flexible, but id like to track this number to make sure the WFH/O ratio stays above 3 for days in the office

    I've got a excel sheet to log this, but id like to clean it up a little.
    Ideally i just want the numbers in AG8 and AG9 without having to run the calculations in the table next to them... but if finding it difficult to get to this number using multiple COUNTIF functions

    The red cell is calculated as a percentage (AJ8/AJ9) but i cant derive this number when i divide multiple COUNTIFS (ie AJ7/AJ6)

    Is there a neat way to just clean all of this up so there's one formula that does all this calculation, so i don't need to have the mini-table for each month?? Ideally i want the running ratio in the top, next to my name (D2) that takes into account the day count rolling across all months! Breaking it down by month won't be correct (AGH14 is wrong for eg) as value in each month stops rolling monthly (if that makes sense?) (i need the COUNTIF to roll down into Feb, then MAr etc, but i cantfigure this out and doing it manually i get an error saying "too many arguments" or something to that effect (ie =COUNTIF(C8:AF8,B14:AF14... etc,"O")

    Sry, v basic skills here!! thanks!!
    Attached Files Attached Files
    Last edited by morayman; 01-11-2024 at 07:57 AM. Reason: edited to fix a mistake for days in Feb!

  2. #2
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    think i've massively overcomplicated my problem here in that explanation... basically i need the sum of multiple rows of COUNIF values in order to account for the data in Jan through to Dec! (ie 12 rows), but i get an error when i try to manually choose the rows and divide it by the days worked COUNTIF...i get an error

    One work around is i sum up the values from each month into a master tableat the top, but hoping theres a cleaner way with less moving parts!!

    Thanks!

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

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

  4. #4
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    ok cool, thats working better...! but ideally i want this formula for the top in D2 & dD3, counting ALL the COUNTIFS for Jan, Feb, Mar.....etc in one formula

    If i do the above formula individually for each moth, it's counting the wrong days (ie Feb starts on a Thursday, so doesn't count a whole 5day week..... so AG14 AND AG15 cells are incorrect (RED SHADED)

    Therein lies the problem... i need to keep a running total of all days in one COUNTIF formula, if that's possible..?
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

    The formula I supplied does exactly what you originally asked for & gives the same values as your formula, so not sure what you mean about Feb.

  6. #6
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    Thanks Fluff13, but I need it for the whole year, not just Jan... =COUNTIFS(B8:AF8,"O")/COUNTIFS(B8:AF8,"<>")*5 is just counting for Jan

    If i try to edit this formula to include all the months, =COUNTIFS(B8:AF8,B13:AD13,B18:AF18,"O")/COUNTIFS(B8:AF8,B13:AD13,B18:AF18,"<>")*5 , i get an error:

    This is running Jan to March end in this example above

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

    For Feb you use
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    Is there a formula that can sum all the months together, not break them down month by month

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

    If that's what you want, why didn't you say so to start with?
    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    Thanks, sorry, im super novice! appreciate your help
    unfort. i get a #DIV/O! error

    BUT THIS IS LOOKING WAYYYY MORE AWESOME!
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

    Please attach a workbook that shows the problem.

  12. #12
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    Attached!
    Thanks vm!
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

    Thanks for that, how about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    WOW. NAILED IT! Looking great!!!
    I'm amazed how there is always a solution to a problem here. Thanks so much Fluff13, legend.

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

    Glad to help & thanks for the feedback.

  16. #16
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    One last thing if i i may.... id also like to be able to include 3 more variables:

    We currently have:

    WFO: O
    WFH: H

    Can i add

    Public Holiday: PH
    Leave: L
    Sick Day: S

    These days shouldn't count towards lowering the average, but id like to be able to add them in the rows if and when necessary. Currently adding any additional letters takes it as WFH (H)
    (I guess this is going back to using COUNTIFS?! Hope not... the solution you provided above is so beautiful!
    Attached Files Attached Files

  17. #17
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

    What should the value in D2 be?

  18. #18
    Registered User
    Join Date
    10-31-2011
    Location
    Singapore
    MS-Off Ver
    Microsoft 365 (Windows 10)
    Posts
    62

    Re: Derive a formula without calculating multiple COUNTIFS

    Hi Fluff13, I'm just going to use colour fills for these values, so any data doesn't interfere with the value in D2.
    What you provided works beautifully!

    Thanks again, marking as SOLVED!

  19. #19
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Derive a formula without calculating multiple COUNTIFS

    Glad to help & thanks for the feedback.

+ 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. Derive column value based on multiple criteria
    By adityatan in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-15-2023, 12:44 PM
  2. Need Formula to derive multiple partial texts
    By micheledambrosio in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-03-2023, 09:44 PM
  3. Replies: 6
    Last Post: 10-11-2017, 04:57 PM
  4. [SOLVED] COUNTIFS: Calculating percentage with multiple criteria
    By ljbrown in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-23-2017, 03:09 PM
  5. Using LINEST to derive a multiple polynomial equation
    By Richatom in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 12-08-2014, 09:09 AM
  6. Derive a formula for multiple variables
    By wvr in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2014, 12:16 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