Getting Date and time based on an IF

mpatino

Board Regular
Joined
Jul 8, 2009
Messages
82
Hi Guys,

I'd like to know if there is a way to extract date and time with VBA based on an IF from a different cell, I can use =if(A1="Yes",Now(),""), however this formula will change the date and time every time the spreadsheet is opened or modify and I need the original date and time to calculate the time that took certain process to complete. Also I'd like to know if it is possible to calculate SLA in hours/minutes based on Start date/time and Closed date/time for example below, thanks for all your help.

A</SPAN>
B</SPAN>
C</SPAN>
D</SPAN>
F</SPAN>
1</SPAN>
Start</SPAN>
Date/Time</SPAN>
Closed</SPAN>
Date/Time</SPAN>
SLA</SPAN>
2</SPAN>
Yes</SPAN>
1/20/2013 13:25</SPAN>
Yes</SPAN>
1/21/2013 2:40</SPAN>
13 hrs 15 min (Closed date/time - Start date/time)</SPAN>
3</SPAN>
No</SPAN>
No</SPAN>
4</SPAN>
Yes</SPAN>
1/20/2013 15:33:00 PM</SPAN>
No</SPAN>
Since this is NO
Date/Time should be current date
and time.




<TBODY>
</TBODY>
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,216,031
Messages
6,128,424
Members
449,450
Latest member
gunars

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