+ Reply to Thread
Results 1 to 9 of 9

Subtracting a max from a min if statement

Hybrid View

  1. #1
    Registered User
    Join Date
    02-25-2016
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    13

    Subtracting a max from a min if statement

    Hi, i'm new here so please accept my apologies if this is posted in the wrong place.

    can anybody please help me with this formula...
    i've been trying to get this to work all week with no luck. i have come up with an idea that i think will now work though but i just dont know how to write it into my existing formula criteria.

    i am currently using an sumifs formula that looks like this.
    =SUMIFS('Picking Targets'!$B$3:$B$5000,'Picking Targets'!$A$3:$A$5000,"")+SUMIFS('Picking Targets'!$B$3:$B$5000,'Picking Targets'!$A$3:$A$5000,$A2,'Picking Targets'!$C$3:$C$5000,B$1)

    this formula will add up all the time transactions ('Picking Targets'!$B$3:$B$5000) if the selected hour is (B$1) and the name of the employee matches ($A2) from range ('Picking Targets'!$A$3:$A$5000) but this doesnt work like i wanted it too.
    so my next idea is to look up the same criteria but instead of summing up all the times, i just want it to subtract the max. time from the min. time which will give me the the time worked of that hour. i have tried this manually and it works, i just dont know how to put it into this formula with the criteria's

    Please help...
    Last edited by robc79; 02-25-2016 at 08:09 AM.

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Subtracting a max from a min if statement

    Hi Welcome to Forum,

    Please upload a sample workbook with expected result.

    Go to advance click on attachment link and attach the workbook.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Registered User
    Join Date
    02-25-2016
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    13

    Post Re: Subtracting a max from a min if statement

    Hi thanks for reply -
    i'm trying to work out the activity of an employee during a specific hour, so if they have only worked for 40 mins i can target only the 40 mins instead of an hour.

    i have uploaded the sheet as requested, its all very new to me this excel so the file is huge

    https://www.dropbox.com/s/jljqb7s9ne...iins.xlsx?dl=0

    oh its the hour cells on the last sheet that im having issues with, i basically want it to subtract the Max from the min instead up adding them all together.
    Last edited by robc79; 02-25-2016 at 06:11 AM.

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Subtracting a max from a min if statement

    Can you please mention some expected result as I'm unable exactly what you want?

  5. #5
    Registered User
    Join Date
    02-25-2016
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    13

    Re: Subtracting a max from a min if statement

    basically if you do a simple =b6 (max value) - B3 (min Value) on the picking targets sheet it returns 0:11:05 which is what i want it to return on the scanner sheet in cell b2

    the current formula thats in B2 of the last tab

    sums up all the transactions in range (Picking Targets'!$B$3:$B$5000)
    when it matches the name in (A2) from range (Picking Targets'!$A$3:$A$5000)
    and matches the hour (B1) from range ('Picking Targets'!$C$3:$C$5000)

    does this make any more sense ??

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Subtracting a max from a min if statement

    Try

    B2=MAX(IF('Picking Targets'!$A$3:$A$5000&'Picking Targets'!$C$3:$C$5000='Scanner Activity in Time'!$A2&'Scanner Activity in Time'!B$1,'Picking Targets'!$B$3:$B$5000))-MIN(IF('Picking Targets'!$A$3:$A$5000&'Picking Targets'!$C$3:$C$5000='Scanner Activity in Time'!$A2&'Scanner Activity in Time'!B$1,IF('Picking Targets'!$B$3:$B$5000>0,'Picking Targets'!$B$3:$B$5000))) with CRTL+SHIFT+ENTER

  7. #7
    Registered User
    Join Date
    02-25-2016
    Location
    manchester
    MS-Off Ver
    2013
    Posts
    13

    Re: Subtracting a max from a min if statement

    you absolute star !! that works great

  8. #8
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Subtracting a max from a min if statement

    Note

    Name Chris Newton 6 hour Max value is 6:59:37 and min value is 6:07:30 and answer will be in your Scanner Activity in Time sheet 52:07.

    Hope it is what you looking for

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Subtracting a max from a min if statement

    Thanks for feedback and glad to help you

    Please add reputation by clicking * star icon of left corner on your screen and mark tread as solved ( for doing these things see the signature below).

+ 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. Subtracting numbers from column until zero then subtracting from second column
    By JPFranklin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-17-2016, 05:20 PM
  2. [SOLVED] If statement subtracting 2 cells
    By Stephen R in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2014, 09:12 AM
  3. Subtracting
    By Suzyplums in forum Excel General
    Replies: 5
    Last Post: 03-28-2007, 08:32 AM
  4. Subtracting...
    By kiddo7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-22-2006, 11:39 AM
  5. Subtracting
    By Josh Davis in forum Excel General
    Replies: 3
    Last Post: 06-16-2006, 02:00 PM
  6. Subtracting One Sum From Another
    By R. U. Sirius in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 09-27-2005, 02:05 PM
  7. [SOLVED] Subtracting
    By Pastor Andrew Alexander in forum Excel General
    Replies: 1
    Last Post: 02-06-2005, 07:06 AM

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