IF Formula with date and time parameters

nmckever

New Member
Joined
Apr 15, 2014
Messages
4
I have an excel spreadsheet, I need to create a formula that will indicate who is responsible for each request given the parameters that are set at the bottom. The responsibility will either be with IND or SCH depending on the date and time that the request was submitted.



Today's DateMUAgent NameActivityRequest DateSubmitted DateSubmitted TimeDayTurnaroundResponsible
11/16/20161234 Test Lvl 1Mouse, MickeyVTO11/18/201611/14/20169:35 AMMon
11/16/20161234 Test Lvl 1Mouse, MickeyPTO Excused11/25/201611/14/20164:29 PMMon
11/16/20162 Tester VilliageWay, RonniePTO Excused11/17/201611/15/20163:42 PMTue
11/16/20162 Tester VilliageDickson, MouseCancel OT- WFM11/18/201611/15/20166:02 AMTue
11/16/2016200 Orlion WayStreet, JoePTO Excused11/25/201611/15/201610:07 PMTue
11/16/2016Sender QueJackson, MichaelVTO11/16/201611/16/20168:53 AMWed
11/16/201612345 Test Lvl 2Jackson, JanetVTO11/25/201611/19/20168:53 AMSat
11/16/2016123 Test lvl 3Jackson, TitoVTO11/30/201611/20/20169:30 AMSun
11/16/2016456 Test lvl 4Mouse, MinnieVTO11/23/201611/21/20167:50 AMMon
11/16/2016789 Test lvl 5Duck, DonaldSpecialist OT11/18/201611/16/20165:30 PMWed
Total10
Parameters
If the request date is the same as the submitted date regardless of the day - IND is responsible
Anything submitted after 4pm - IND is responsible
Anything submitted before 8am - IND is responsible
Anything submitted on Sat and Sun - IND is responsible
Anything Submitted between 8a-4pm Mon - Fri - SCH is responsible

<colgroup><col><col><col><col><col><col><col><col span="2"><col></colgroup><tbody>
</tbody>
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
As you haven't told us your column references, I'll have to generalise, but this might get you going...

=if(or(([request date]=[submitted date]),([submitted time]> 16/24),([submitted time]< 8/24),[day]="Sat",[day]="Sun"),"IND","SCH")

Replace the bits in square brackets with the actual cell references.
Assumptions
DAY is text, not number formatted to appear as day.
1st parameter takes precedence over final parameter.
 
Upvote 0
The 'day' column is a formula formatted to reflect the actual day. Is there a way I can remove the formula and it still reflect the information that I am trying to recover?
 
Last edited:
Upvote 0
OK, then you can probably embed a couple of instances of the WEEKDAY function to deal with that.

For example
=if(or(([request date]=[submitted date]),([submitted time]> 16/24),([submitted time]< 8/24),weekday([day],1)=1,weekday([day],1)=7),"IND","SCH")
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,635
Members
449,043
Latest member
farhansadik

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