IF Formula

jgp19

New Member
Joined
Jun 16, 2024
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Can anyone help to write to if formula for below scenario?

employee joining date having less than date 01-06-2024 in a cell then give value of 30 days having in a cell and if employee joining date having equal or higher date that is 30-06-2024, then give value subtracting 30-06-2024-02-06-2024.

Please help.

1718559939934.png
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
welcome to the forum. Can you give some examples with expected results?
 
Upvote 0
welcome to the forum. Can you give some examples with expected results?
I have a employees joining date in one column A, total number of days in a month i.e 30 in column B. I want to have actual work days in column C. Expected results should be if joining date mentioned in column A less than 1St June 2024, then I should value of 30 days in the column C. If joining date is higher than or equal to 1St June 2024 then I need a value of days after subtracting 6/30/2024 - any higher or equal date of 6/01/2024.
 
Upvote 0
Still sort of unsure what you want. But try this:


Book1
ABC
1
2Current Month2024-06-01
3Current Month Formatted as mmmJun
4JoinDays This MonthWork Days This Month
52024-06-133012
62024-01-223020
Sheet4
Cell Formulas
RangeFormula
C3C3=C2
B5:B6B5=EOMONTH($C$2,0)-EOMONTH($C$2,-1)
C5:C6C5=NETWORKDAYS(MAX(A5,EOMONTH($C$2,-1)+1),EOMONTH($C$2,0))


NOTE: If you are concerned with Holidays or weekends that are not Sat and Sun you can use the NETWORKDAYS.INTL function.
 
Upvote 0
not sure what that means. What are the answers you want to see in C5 and C6?
 
Upvote 0
I want actual number of days worked in c5 and c6.
in case the employees joined before 1st of June 2024 it should show me the number of worked days as 30 only.
in case the employee joined in any day of June 2024 it should show actual worked days in the month of June.
 
Upvote 0
I want actual number of days worked in c5 and c6.

in case the employee joined in any day of June 2024 it should show actual worked days in the month of June.
You really need to give a concrete expected number:

Book1
ABC
12024-06-01Month End Date:2024-06-30
2Current Month2024-06-01
3Current Month Formatted as mmmJun
4JoinDays This MonthWork Days This Month
52024-06-13302
62024-01-223030
Sheet4
Cell Formulas
RangeFormula
C1C1=EOMONTH(C2,0)
C3C3=C2
B5:B6B5=EOMONTH($C$2,0)-EOMONTH($C$2,-1)
C5:C6C5=IF(A5>$A$1,NETWORKDAYS(A5,TODAY()),30)
 
Upvote 0
Thanks for the above formula it is almost ok, however result in c5 should be subtract of (2024-06-30 - 2024-06-13) = 18 days.
this requirement is for payroll where we use month end to count number of working days of employee, so if we use "today" in formula it gives result as of today worked day but i want to see work days as month end date.
 
Upvote 0
Try this:

Book1
ABC
11/6/2024Month End Date30/6/2024
2
3
4JoinDays This MonthWork Days This Month
513/6/202418
622/1/202430
Sheet1
Cell Formulas
RangeFormula
C1C1=EOMONTH(A1,0)
C5:C6C5=$C$1-MAX(A5,$A$1)+1
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,847
Members
451,674
Latest member
TJPsmt

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