Sumif month matches and days

forginganewone

Board Regular
Joined
Mar 14, 2018
Messages
64
Hi friends!!
I need help with another thing, so basically I have to calculate salaries monthly and have three columns in data 1) Start date for employee 2) End date for employee 3) Salary.

But it should be able to calculate salary for number of days in that month for example in row 1, start date is 16 Nov. So for Nov it should calculate 1000/30*14 since only the employee will work for only 14 days in November.

Secondly It should consider if end date and if end date is blank then it should also calculate

|+|Start Date|End Date|Salary|
|:-|:-|:-|:-|
|1|16-11-21|30-Dec-21| 1,000 |
|2|16-11-21|30-Nov-21| 1,000 |
|3|16-11-21|15-Dec-21| 1,000 |
|4|16-11-21| | 1,000 |

Sample Results

|+|Nov|Dec|
|:-|:-|:-|
|1| 467 | 1,000 |
|2| 467 | - |
|3| 467 | 500 |
|4| 467 | 1,000 |

Note* I require to sum for whole Nov and Dec for salaries falling in the month just did row on row in sample result for clarity.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
But it should be able to calculate salary for number of days in that month for example in row 1, start date is 16 Nov. So for Nov it should calculate 1000/30*14 since only the employee will work for only 14 days in November.

Why it's 14?
16 to 30 November is 15 days
 
Upvote 0
I am still not getting what to do is end date is blank

but Try this if it works with end date

Book2
ABCDE
1NamesStart DateEnd DateMonthlyPayable
2Name111/16/202111/30/20211000500
3Name211/16/202111/30/20211000500
4Name311/16/202112/15/20211000968
Sheet1
Cell Formulas
RangeFormula
E2:E4E2=ROUND(SUMIFS(D2:D2,B2:B2,">="&B2,C2:C2,"<="&C2)/DAY(EOMONTH(C2,0)*1)*(C2-B2+1),0)
 
Upvote 0
Thank you for your effort but as per the *Note in my post, I want to calculate it complete for the month and not row by Row.
For example on a new sheet there will only be months mentioned and total salaries falling in those months will be shown in a single cell
 
Upvote 0

Forum statistics

Threads
1,214,817
Messages
6,121,717
Members
449,050
Latest member
MiguekHeka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top