+ Reply to Thread
Results 1 to 7 of 7

Formula to average work days and non work days (weekends)

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Formula to average work days and non work days (weekends)

    Hi all

    I need some help please to work out an average based on either a work day or weekend.

    e.g. in Cells C4:Z4 I have amounts charged per day. What I would like in column AC is to work out the average in that row of all yellow cells. Then in column AD to work out the average of all green cells.

    Can anyone help with the formula please?
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Formula to average work days and non work days (weekends)

    In Power Query, I have extracted the desired info. It is in a different format than you have requested, but you can re-arrange as needed.

    Excel 2016 (Windows) 32 bit
    AC
    AD
    AE
    2
    Column1 Custom Average
    3
    E.007115.07.01 Weekday
    6643.099375
    4
    E.007115.07.01 Weekend
    5227.97375
    5
    E.007116.07.01 Weekday
    15554.13438
    6
    E.007116.07.01 Weekend
    14451.625
    7
    E.007116.05.01 Weekday
    650.28
    8
    E.007116.05.01 Weekend
    68.78
    9
    E.007116.08.03.01 Weekday
    218.0533333
    10
    E.007160.05.01.01 Weekday
    2201.258438
    11
    E.007160.05.01.01 Weekend
    374.7378125
    12
    E.007160.05.01.02 Weekday
    177.87
    13
    E.007160.05.01.02 Weekend
    168.84
    14
    E.007077.05.01.01 Weekday
    1318.317031
    15
    E.007077.05.01.01 Weekend
    84.84
    Sheet: Data

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    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
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Formula to average work days and non work days (weekends)

    Or with a formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,783

    Re: Formula to average work days and non work days (weekends)

    AC4=IFERROR(SUMPRODUCT((WEEKDAY($C$3:$Z$3,2)<=5)*($B$4:$B$10=$B4)*($C$4:$Z$10>0)*($C$4:$Z$10))/SUMPRODUCT((WEEKDAY($C$3:$Z$3,2)<=5)*($C4:$Z4<>"")),"")

    Copy down


    AD4=IFERROR(SUMPRODUCT((WEEKDAY($C$3:$Z$3,2)>=6)*($B$4:$B$10=$B4)*($C$4:$Z$10>0)*($C$4:$Z$10))/SUMPRODUCT((WEEKDAY($C$3:$Z$3,2)>=6)*($C4:$Z4<>"")),"")

    Copy down

  5. #5
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Formula to average work days and non work days (weekends)

    Thanks Alan - sadly I cant use that functionality. I tried but I am unable to install the Add in so I will be contacting IT to enable that on my work laptop.

    Thank you Fluff13 and Caracalla, both worked great!

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

    Re: Formula to average work days and non work days (weekends)

    Glad to help & thanks for the feedback.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Formula to average work days and non work days (weekends)

    @pauldaddyadams
    Power Query is already part of your version. If you read my entire post, you would have seen that it is called Get and Transform and further it is found on the Data Tab of the ribbon.

    There is no need to download any thing. If you follow the directions, I posted, and look at the file provided, you will find everything you need to make it work.

+ 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] How to calculate task schedule based on 4-days work and 4-days OFF including weekends
    By qadeerume in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-28-2020, 12:19 AM
  2. [SOLVED] Determine a work week date question if days off are not on weekends
    By lilsnoop in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 08-05-2016, 09:29 PM
  3. [SOLVED] Counting work days, not weekends
    By joebell in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-13-2013, 05:45 PM
  4. [SOLVED] Count only work days, not weekends
    By greenjl7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-22-2013, 11:56 AM
  5. Replies: 5
    Last Post: 07-11-2006, 01:56 PM
  6. Difference between 2 dates, incl weekends, with variable work days
    By babryanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-07-2006, 06:24 PM
  7. Replies: 2
    Last Post: 04-08-2005, 03:06 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