+ Reply to Thread
Results 1 to 13 of 13

Formula tweek

  1. #1
    Registered User
    Join Date
    09-05-2017
    Location
    Cleveland,TN
    MS-Off Ver
    Office 2016
    Posts
    7

    Question Formula tweek

    I have searched and studied the sumif and sumifs and still cant find an answer.

    I would like help writing a formula to only total cells that produce a negative number. Example Tuesday 7.5<8 = .5

    To calculate how much vacation time an employee has used.

    Monday 8 hours
    Tuesday 7.5 hours
    Wednesday 8 hours
    Thursday 8.5 hours
    Friday 7 hours

    In this case the total hours used .5 on Tuesday and 1.0 on Friday would be 1.5 hours of vacation used, the extra .5 hour on Thursday would be paid so it does not fall under the <8 rule.
    The closest I have come is adding a column and hiding it that takes the hours in each cell worked and subtract it from 8 but it adds the positive also. So instead of the total being -1.5 the total is -1.0
    8-8 =0
    7.5-8 =-.5
    8-8 =0
    8.5-8 =.5
    7-8 = -1.0
    --------------
    -1.0

    So
    1. can this be done in a single column?
    2. is there a way to omit positive number from the total?

    Thanks
    Tim

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula tweek

    E1 =sumif($c1:$c5,"<0")
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    09-05-2017
    Location
    Cleveland,TN
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Formula tweek

    Thank you oeldere

    Now on to work on the rest of this sheet.

    Tim

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula tweek

    You're welcome. We appreciate the feedback!

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

    It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,918

    Re: Formula tweek

    Or:

    =SUMPRODUCT((B1:B5<>0)*(B1:B5-8))

  6. #6
    Registered User
    Join Date
    09-05-2017
    Location
    Cleveland,TN
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Formula tweek

    Thank you Phuocam

  7. #7
    Registered User
    Join Date
    09-05-2017
    Location
    Cleveland,TN
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Formula tweek

    Ok Even if I enter hours into the slots with text this does not seem to work. I would like to have 8 hours deducted if I enter PD or paid in the field when they take off.
    It gives me a total but it is not accurate it should be 5x8 days off plus 6 for 54 hours off not 61.44 I even tried anchoring it with the $ signs.
    To use the E1 =sumif($c1:$c5,"<0") I need to create a new column.
    I have played with several different ways to make the formula work to no avail. In this sample we just need to total hours used (54) ignoring anything =>8


    Oct.docx

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula tweek

    add an excelfile instead of a doc.

  9. #9
    Registered User
    Join Date
    09-05-2017
    Location
    Cleveland,TN
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Formula tweek

    Sorry was not sure that a live file was allowed.

    Test1.xlsx

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula tweek

    See if this is the right result

    I16 = 46

    If so I will add the formula's together.

  11. #11
    Registered User
    Join Date
    09-05-2017
    Location
    Cleveland,TN
    MS-Off Ver
    Office 2016
    Posts
    7

    Re: Formula tweek

    Oeldere,

    Yes that appears right, I had the sumif on it like that minus the anchor, but the text was messing me up.If I just changed the text to 8 it gave me the wrong answer.
    I know it has to be something simple that I missed.
    Something so simple in my mind and poof mind blown.

    Makes me want to become an expert in Excel just so I can figure it out.

    Tim

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula tweek

    And g16 houses the (total added) formula if you want to use that.

  13. #13
    Registered User
    Join Date
    09-05-2017
    Location
    Cleveland,TN
    MS-Off Ver
    Office 2016
    Posts
    7

    Thumbs up Re: Formula tweek

    Wonderfull that should do it. I need to add a couple tweeks but am familiar on how that works.

    The 8+8-sumif after the wild card I think is where I needed to look. I am sure anchoring the cells was also a big part.

    Thanks so much again Oeldere.

+ 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. Macro Tweek
    By stuartgood24 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-16-2013, 10:55 AM
  2. VLOOKUP Tweek
    By cadamhill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-30-2012, 05:34 PM
  3. [SOLVED] This code needs a little tweek...
    By Legend Rubber in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-16-2012, 04:42 PM
  4. [SOLVED] Trying to tweek an "If" formula
    By ExcelNUBs in forum Excel General
    Replies: 4
    Last Post: 07-17-2012, 10:47 AM
  5. little tweek needed
    By khalid79m in forum Excel General
    Replies: 2
    Last Post: 01-03-2007, 07:21 AM
  6. need a tweek
    By khalid79m in forum Excel General
    Replies: 1
    Last Post: 12-29-2006, 07:38 AM
  7. Need to tweek code
    By yh73090 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-26-2005, 10:14 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