+ Reply to Thread
Results 1 to 12 of 12

How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

  1. #1
    Registered User
    Join Date
    06-24-2019
    Location
    Atlanta
    MS-Off Ver
    365
    Posts
    12

    Question How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    Hello,
    I am trying to estimate the monthly salary for mid month hire/terminated employees. In the attached model, the data is summarized in the "Analysis" tab and DBV tab contains the raw data.
    The Analysis tab is arranged by Year, Quarter and then month(column MC onwards). The monthly section contains the "Sumproduct" equation to bring the data from DBV to Anlaysis tab. The monthly salary (Annual/12)is calculated in column L of DBV tab. The issue is that I am assuming full month salary for mid month hire or terminated employees. How do I ensure that if a person who joins on 10th of a month gets paid for only the remaining working day of the month? Similarly for terminated employees should get paid for days worked during the termination month and not the entire month. How do I change the equation?


    Equation:
    =SUMPRODUCT(--('HC DBV'!$G$9:$G$645=Analysis!$I46),--('HC DBV'!$C$9:$C$645<=MC$1),--('HC DBV'!$D$9:$D$645>MD$1),'HC DBV'!$L$9:$L$645)+SUMPRODUCT(--('HC DBV'!$G$9:$G$645=Analysis!$I46),--('HC DBV'!$C$9:$C$645<=MC$1),--('HC DBV'!$D$9:$D$645=""),'HC DBV'!$L$9:$L$645)

    The first sumproduct estimates the salary for the person hired on or before the month and terminated in the future. The second sum product estimates the salary for active employees hired on or before the month.
    Attached Files Attached Files
    Last edited by ShriHanuman; 11-07-2021 at 05:07 PM.

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    Just a suggestion to improve your worksheet with tables.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-24-2019
    Location
    Atlanta
    MS-Off Ver
    365
    Posts
    12

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    Thanks for the suggetion

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    It seems to me that there would be three groups that need to be summed.
    1. Those that were hired before or on the first day of the month AND terminated on or after the last day of the month OR not terminated.
    2. Those that were hired before or on the first day of the month AND terminated before the last day of the month.
    3. Those that were hired after the first day of the month AND before the last day of the month AND terminated on or after the last day of the month OR not terminated.
    I believe that the following formula covers those three groups:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that after the formula is activated in cell MC46 the fill handle may be dragged down to MC47 and then, while MC46:MC47 are still selected, over to cell MN47.
    Let us know if you have any questions.

    EDIT: I forgot to mention that I added two columns (M:N) on the HC DBV sheet (see the attached file).
    Column M shows the salary for the first month of employment using: =(EOMONTH(C9,0)-C9)/DAY(EOMONTH(C9,0))*L9
    Column N shows the salary for the last month of employment using: =IF(D9="",1,(D9-(EOMONTH(D9,-1)+1))/DAY(EOMONTH(D9,0)))*L9
    Attached Files Attached Files
    Last edited by JeteMc; 11-13-2021 at 09:48 AM. Reason: Added edit
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    06-24-2019
    Location
    Atlanta
    MS-Off Ver
    365
    Posts
    12

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    Quote Originally Posted by JeteMc View Post
    It seems to me that there would be three groups that need to be summed.
    1. Those that were hired before or on the first day of the month AND terminated on or after the last day of the month OR not terminated.
    2. Those that were hired before or on the first day of the month AND terminated before the last day of the month.
    3. Those that were hired after the first day of the month AND before the last day of the month AND terminated on or after the last day of the month OR not terminated.
    I believe that the following formula covers those three groups:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that after the formula is activated in cell MC46 the fill handle may be dragged down to MC47 and then, while MC46:MC47 are still selected, over to cell MN47.
    Let us know if you have any questions.

    EDIT: I forgot to mention that I added two columns (M:N) on the HC DBV sheet (see the attached file).
    Column M shows the salary for the first month of employment using: =(EOMONTH(C9,0)-C9)/DAY(EOMONTH(C9,0))*L9
    Column N shows the salary for the last month of employment using: =IF(D9="",1,(D9-(EOMONTH(D9,-1)+1))/DAY(EOMONTH(D9,0)))*L9
    Thank you for the reply. Appreciate it!.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  7. #7
    Registered User
    Join Date
    06-24-2019
    Location
    Atlanta
    MS-Off Ver
    365
    Posts
    12

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    Quote Originally Posted by JeteMc View Post
    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.
    Done. Thanks

  8. #8
    Registered User
    Join Date
    06-24-2019
    Location
    Atlanta
    MS-Off Ver
    365
    Posts
    12

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    Quote Originally Posted by JeteMc View Post
    It seems to me that there would be three groups that need to be summed.
    1. Those that were hired before or on the first day of the month AND terminated on or after the last day of the month OR not terminated.
    2. Those that were hired before or on the first day of the month AND terminated before the last day of the month.
    3. Those that were hired after the first day of the month AND before the last day of the month AND terminated on or after the last day of the month OR not terminated.
    I believe that the following formula covers those three groups:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Note that after the formula is activated in cell MC46 the fill handle may be dragged down to MC47 and then, while MC46:MC47 are still selected, over to cell MN47.
    Let us know if you have any questions.

    EDIT: I forgot to mention that I added two columns (M:N) on the HC DBV sheet (see the attached file).
    Column M shows the salary for the first month of employment using: =(EOMONTH(C9,0)-C9)/DAY(EOMONTH(C9,0))*L9
    Column N shows the salary for the last month of employment using: =IF(D9="",1,(D9-(EOMONTH(D9,-1)+1))/DAY(EOMONTH(D9,0)))*L9
    One quick follow-up question: When you write (('HC DBV'!$D$9:$D$645>=MC$1)+('HC DBV'!$D$9:$D$645="")) and multiple each term what do these individual terms return if they are true. Normally --(A=B) return 1 if true.
    I was trying to write an array function for your equation using "--" and it did not work. Example: SUMPRODUCT(--('HC DBV'!$G$9:$G$645=Analysis!$I46),--('HC DBV'!$C$9:$C$645<=EOMONTH(MC$1,-1)+1),--OR(('HC DBV'!$D$9:$D$645>=MC$1),('HC DBV'!$D$9:$D$645="")),('HC DBV'!$L$9:$L$645))

    Thanks in advance.

  9. #9
    Registered User
    Join Date
    06-24-2019
    Location
    Atlanta
    MS-Off Ver
    365
    Posts
    12

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    Hi JeteMC,
    I noticed that if I terminate all except one of the active employees in July of 2021 and terminate the remaining one in August of 2021, the compensation information is still being carried till the end of December. It does not zero out after August. Please see the attached excel.
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    I missed a consideration in the terminated before the end of the month segment.
    Try the following:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In the attached file the formulas in rows 51:53 are for verification of each segment, and are not needed for the actual calculations in rows 46:47.
    Let us know if you have any questions.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-24-2019
    Location
    Atlanta
    MS-Off Ver
    365
    Posts
    12

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    Quote Originally Posted by JeteMc View Post
    I missed a consideration in the terminated before the end of the month segment.
    Try the following:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In the attached file the formulas in rows 51:53 are for verification of each segment, and are not needed for the actual calculations in rows 46:47.
    Let us know if you have any questions.
    Thank you for the reply

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,563

    Re: How to cal. monthly salary for mid hire/termination using Sumifs or SUmproduct

    You're Welcome. Thank You marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Calculate Headcount by department, based on Hire date and Termination date
    By Cornelia in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-11-2020, 07:42 AM
  2. Replies: 1
    Last Post: 11-22-2017, 05:27 AM
  3. [SOLVED] Need formula for prorating monthly salary based on hire/fire date and annual salary.
    By Excel_Help_Pls in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-06-2015, 12:56 AM
  4. Replies: 1
    Last Post: 10-23-2014, 08:10 AM
  5. Replies: 3
    Last Post: 07-26-2012, 04:11 PM
  6. Replies: 2
    Last Post: 05-30-2012, 10:53 AM
  7. Salary monthly allocation based on Hire date
    By thomas.mapua in forum Excel General
    Replies: 1
    Last Post: 08-21-2011, 08:45 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