10 Replies Latest reply on May 8, 2018 2:41 PM by Deepak Rai

# Calculation on Adding days to specific date based on some conditions

Hi,

I have been working on one of the project about student enrollment in specific university.

Please see attached filed with data in it, however, there is 'Result' column which i am looking for from calculation.

Here is scenario, there is hiring date for each student but completion date (Due Date) for student who hired before 31 December 2017 should be as it is. However, for other student enrolled on and after 1 January 2018, due date should be +60 days to due date of students enrolled on and before 31 December 2017. For more detail, please refer attached file as it has clear idea what and where i am looking.

I have tried different IF statement to get that answer but not able to solved it.

For Example, first i did create one variable call [A_DueDate] by applying this formula;

IF [Hiring Date] <#1/01/2018# THEN DATEADD ('day',60,[Due Date]) Else [Due Date] End

Then i called that variable by using another IF statement like below;

IF [Hiring Date] > #1/01/2018#  THEN [A_DueDate] Else [Due Date] End

But didn't work. Then i tried to include nested IF statement but that didn't work too.

Can any one please help me out to get required result as shown in attached excel file?

Any help would be appreciated.

If you have any questions then please feel free to ask me any time.

Thanks

• ###### 1. Re: Calculation on Adding days to specific date based on some conditions

Hi Amit,

Here it is

You can Change as per your local date formating as dd/mm/yyyy.

Thanks

Deepak

If it helps, pl mark it helpful and CORRECT to Close Thread.

1 of 1 people found this helpful
• ###### 2. Re: Calculation on Adding days to specific date based on some conditions

Hello Amit,

Can you try with date format #2018-01-01# (yyyy-mm-dd), instead of #1/01/2018#. I suspect that is the issue.

S

1 of 1 people found this helpful
• ###### 3. Re: Calculation on Adding days to specific date based on some conditions

Hello Sir,

Thank you so much for your help and your formula did work perfectly fine.

My apologies for late response.

Thanks

• ###### 4. Re: Calculation on Adding days to specific date based on some conditions

Hello Sudheer,

Thank you so much for your help too ...but it was not an issue.

Issue was DATEADD function where i didn't use MAX aggregate function.

Thanks

• ###### 5. Re: Calculation on Adding days to specific date based on some conditions

Hi Amit,

If it helped, can you please take  a sec to close the thread by marking my reply as CORRECT. The CORRECT button is under my answer in your this main thread, not in email.

Thanks

Deepak

• ###### 7. Re: Calculation on Adding days to specific date based on some conditions

Deepak,

I am sorry i am new to this community can you please tell How can i close this thread?

Thanks

• ###### 8. Re: Calculation on Adding days to specific date based on some conditions

Oh..No Problem...Just go to your this main thread, not in email, you would find a CORRECT button under my Reply. Press it and Thread will be closed. That's it.

• ###### 9. Re: Calculation on Adding days to specific date based on some conditions

Just did it.

Thank you again for your help.

Thanks

• ###### 10. Re: Calculation on Adding days to specific date based on some conditions

Welcome!!!