+ Reply to Thread
Results 1 to 13 of 13

Ignoring cells with 0 value when averaging

  1. #1
    Registered User
    Join Date
    06-25-2016
    Location
    tennessee
    MS-Off Ver
    Excel mobile app
    Posts
    7

    Ignoring cells with 0 value when averaging

    I am working on a time sheet. The guys get a minimum of 56 hours every week they they work (7 day weeks) but we don't work every day so for example if we work 3 days, they get a 24 hour minimum. I'm trying to figure out how to work out an if then type line where if they have less than an 8 hour average for the days they work the total is adjusted to the 8 hour average. Any suggestions?
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Ignoring cells with 0 value when averaging

    Hi, welcome to the forum

    Try this...
    =AVERAGEIF(J5:J18,"<>")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-25-2016
    Location
    tennessee
    MS-Off Ver
    Excel mobile app
    Posts
    7
    Quote Originally Posted by FDibbins View Post
    Hi, welcome to the forum

    Try this...
    =AVERAGEIF(J5:J18,"<>")
    That's a great start thank you very much. I think i might should have worded the question a bit differently and an average formula may nkt be exactly what im looking for. The other thing i need to do there is make it able to adjust the value up to the minimum. For example on that first page named alberto on the days 6/14 through 6/19 he worked 41.5 hours. I need that number bumped up to 48 hours. Thank you for the quick reply.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Ignoring cells with 0 value when averaging

    OK, something like this?
    =MAX(SUM(J5:J18),COUNTA(J13:J18)*8)

  5. #5
    Registered User
    Join Date
    06-25-2016
    Location
    tennessee
    MS-Off Ver
    Excel mobile app
    Posts
    7
    Quote Originally Posted by FDibbins View Post
    OK, something like this?
    =MAX(SUM(J5:J18),COUNTA(J13:J18)*8)
    That is exactly what I needed. Thank you very much. Ive had a few classes in highschool and college that taught excel, and used it alot in physics and chemistry classes, but never had to deal with anything like this. I've got a lot more to learn than i realized.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Ignoring cells with 0 value when averaging

    Happy to help (and no, you have a LOT to learn lol)

    A question for you...
    how will you determine which rows to use if you have 4 weeks worth of data in your table?

  7. #7
    Registered User
    Join Date
    06-25-2016
    Location
    tennessee
    MS-Off Ver
    Excel mobile app
    Posts
    7
    Quote Originally Posted by FDibbins View Post
    Happy to help (and no, you have a LOT to learn lol)

    A question for you...
    how will you determine which rows to use if you have 4 weeks worth of data in your table?
    I will only have 2 weeks at a time in the table (payday is every 2 weeks). I will be using that formula twice, once for rows 5 through 11 and again for 12 through 18 and totaling them for the final hours the check is for. Thats the way the hours are figured, minimum 8 hour a day average ending each week. Unless of course there is a better way to write the formula.
    Last edited by jbroberson21; 06-26-2016 at 01:07 AM.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Ignoring cells with 0 value when averaging

    OK, if it will only be for 2 weeks, then probably not worth putting something together to look at dates

  9. #9
    Registered User
    Join Date
    06-25-2016
    Location
    tennessee
    MS-Off Ver
    Excel mobile app
    Posts
    7
    Quote Originally Posted by FDibbins View Post
    OK, if it will only be for 2 weeks, then probably not worth putting something together to look at dates
    I have another small problem sometime, but only sometimes, our "days" dont end until the early hours of the next morning but i would like to keep the work day together on the day it started on to keep it simpler to look at. The problem is, with the formula the file had when i downloaded it, it doesnt figure the hours right. The formula they used is in column k. Its (e#-d#)+(h#-g#) with # being the row number. Is there a way to write something for that with out the PM start time to AM end time messing it up? *EDIT*. After making this post i found this (h#-g#+(h#<g#)) to fix the second half of the existing formula. Is there a better way of doing that, or should that work well?
    Last edited by jbroberson21; 06-26-2016 at 01:35 AM.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Ignoring cells with 0 value when averaging

    You will probably only need the 2nd part of this, but I did it for both parts...
    =MOD(E5-D5,1)+MOD(H5-G5,1)

  11. #11
    Registered User
    Join Date
    06-25-2016
    Location
    tennessee
    MS-Off Ver
    Excel mobile app
    Posts
    7
    Quote Originally Posted by FDibbins View Post
    You will probably only need the 2nd part of this, but I did it for both parts...
    =MOD(E5-D5,1)+MOD(H5-G5,1)
    Answered before I even found my less convenient option that I edited to add to the previous post. Thanks again for all the help.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Ignoring cells with 0 value when averaging

    Happy to help
    If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Ignoring cells with 0 value when averaging

    Thanks for the rep

+ 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. Averaging Filtered Columns while ignoring zero
    By kritter in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-04-2012, 09:49 PM
  2. Excel 2007 : Averaging Averages Whilst Ignoring Zeros
    By Jeff_Farrar in forum Excel General
    Replies: 2
    Last Post: 02-14-2011, 06:58 PM
  3. Replies: 8
    Last Post: 03-16-2010, 08:04 AM
  4. Averaging non continuous cells, and ignoring cells with errors
    By bog3494 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2008, 02:06 PM
  5. Averaging numbers while ignoring blank cells.
    By bjordan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-03-2007, 05:09 PM
  6. [SOLVED] Averaging noncontiguous numbers ignoring zeros?
    By Mike in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 03-03-2005, 11:06 PM
  7. [SOLVED] Averaging, ignoring zeros
    By Mark in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-28-2005, 07:06 PM
  8. [SOLVED] Averaging numbers but ignoring < and - entries
    By KIM in forum Excel General
    Replies: 4
    Last Post: 02-23-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