+ Reply to Thread
Results 1 to 12 of 12

Subtractifs

  1. #1
    Forum Contributor keith740's Avatar
    Join Date
    04-24-2015
    Location
    Racine, Ohio
    MS-Off Ver
    MS365
    Posts
    241

    Subtractifs

    Hello Forum,

    I know excel doesn't have a subtractifs, but that's what im shooting for.

    I have 8 tables representing each hour descending column A:B

    I need to find the difference in $ each hour

    thing is the agents in column A are not static and will change order each hour, so will need to be an IF formula.

    any help is greatly appreciated.
    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
    52,946

    Re: Subtractifs

    Are you OK with using a helper column?
    (otherwise I can come up with an ugly OFFSET() formula, if you want)
    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
    Forum Contributor keith740's Avatar
    Join Date
    04-24-2015
    Location
    Racine, Ohio
    MS-Off Ver
    MS365
    Posts
    241

    Re: Subtractifs

    helper columns are fine... i have tons allready lol

  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
    52,946

    Re: Subtractifs

    This if the OFFSET formula...
    =INDEX(OFFSET($A$1,(INT(ROWS($A$1:A1)/$G$1)+1)*12+1,1,10,1),MATCH(M14,OFFSET($A$1,(INT(ROWS($A$1:A1)/$G$1)+1)*12+1,0,10,1),0))-INDEX(OFFSET($A$1,(INT(ROWS($A$1:A1)/$G$1))*12+1,1,10,1),MATCH(M14,OFFSET($A$1,(INT(ROWS($A$1:A1)/$G$1))*12+1,0,10,1),0))
    (we will need to fiddle with this if your table does not start in row 1)

  5. #5
    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
    52,946

    Re: Subtractifs

    hmm perhaps my OFFSET formula may be a better approach here, considering all the messing around...
    The alternative is to add a helper column - which you can hide if you want - (I used C), and use this approach...
    C1 =A1 (this is teh starting "seed"
    C2=IF(LEFT(A2,4)="Hour",A2,C1)
    copied down

    Then put Hour2, Hour3 etc in your summary table
    another helper column (I used L)
    L13=IF(LEFT(M13,4)="Hour",M13,L12)
    copied down

    For the extract...
    N14=INDEX($B$1:$B$100,MATCH(L14&M14,INDEX($C$1:$C$100&$A$1:$A$100,0),0))-INDEX($B$1:$B$100,MATCH(LEFT(L14,4)&RIGHT(L14,1)-1&M14,INDEX($C$1:$C$100&$A$1:$A$100,0),0))
    copied down

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,422

    Re: Subtractifs

    What about

    =SUMIF($A$14:$A$23,M14,$B$14:$B$23)-SUMIF($A$2:$A$11,M14,$B$2:$B$11)

    in N14 and down, and

    =SUMIF($A$26:$A$35,M26,$B$26:$B$35)-SUMIF($A$14:$A$23,M26,$B$14:$B$23)

    in N26 and down?

    Edit Typos on cell addresses.
    Dave

  7. #7
    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
    52,946

    Re: Subtractifs

    I was trying to make something that could just be copied all teh way down

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,422

    Re: Subtractifs

    Hmm. I missed the "mission" ... again.

  9. #9
    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
    52,946

    Re: Subtractifs

    Actually, you made me re-think my 2nd formula a bit to this...
    =SUMIFS(B:B,C:C,L14,A:A,M:M)-SUMIFS(B:B,C:C,LEFT(L14,4)&RIGHT(L14,1)-1,A:A,M:M)

  10. #10
    Forum Contributor keith740's Avatar
    Join Date
    04-24-2015
    Location
    Racine, Ohio
    MS-Off Ver
    MS365
    Posts
    241

    Re: Subtractifs

    Awesome, got it! Ty again Guys...

    Im petitioning that MS add SUBTRACTIFS function!

  11. #11
    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
    52,946

    Re: Subtractifs

    Good luck with that

    Glad we could help, thanks for the feedback

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2405
    Posts
    13,422

    Re: Subtractifs

    Ditto.____________

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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