Link to home
Start Free TrialLog in
Avatar of W.E.B
W.E.B

asked on

Excel Formula-Macro

Hello,
can you please help with a formula for below conditions,
I need to put this into a macro.
Any help is appreciated. (Sample Attached)

IF Service (Column AF) =        107      AND DateTime (Column C)  < =      Date @ 12-00-00.00      Then (Column D) =       DateTime + 2 HRS
IF Service (Column AF) =        109      AND DateTime (Column C)  < =      Date @ 12-00-00.00      Then (Column D) =       DateTime + 5 HRS
IF Service (Column AF) =        313      AND DateTime (Column C)  < =      Date @ 12-00-00.00      Then (Column D) =       DateTime + 1 Day @ 18-00-00.00
IF Service (Column AF) =        123      AND DateTime (Column C)  < =      Date @ 12-00-00.00      Then (Column D) =       DateTime + 1 Day @ 12-00-00.00
IF Service (Column AF) =        124      AND DateTime (Column C)  < =      Date @ 12-00-00.00      Then (Column D) =       DateTime + 1 Day @ 17-00-00.00
                              
IF Service (Column AF) =      107      AND DateTime (Column C)  < =      Date @ 17-00-00.00      Then (Column D) =       DateTime + 1 Day @ 10-00-00.00
IF Service (Column AF) =      109      AND DateTime (Column C)  < =      Date @ 17-00-00.00      Then (Column D) =       DateTime + 1 Day @ 13-00-00.00
IF Service (Column AF) =      313      AND DateTime (Column C)  < =      Date @ 17-00-00.00      Then (Column D) =       DateTime + 1 Day @ 18-00-00.00
IF Service (Column AF) =      123      AND DateTime (Column C)  < =      Date @ 17-00-00.00      Then (Column D) =       DateTime + 1 Day @ 12-00-00.00
IF Service (Column AF) =      124      AND DateTime (Column C)  < =      Date @ 17-00-00.00      Then (Column D) =       DateTime + 1 Day @ 17-00-00.00
Sample.xlsx
SOLUTION
Avatar of Ejgil Hedegaard
Ejgil Hedegaard
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of W.E.B
W.E.B

ASKER

Thank you very much guys,
both worked.
You're welcome. Glad we could help.