Excel and Time Ranges

jglanz

New Member
Joined
Mar 15, 2023
Messages
4
Office Version
  1. 365
Platform
  1. MacOS
HI, I'm trying to figure out the formula for this. If let's say 9:01 Am falls in between 9:00am and 4:00pm then assign it to EM. And then continuing if a time falls between 4-8pm and then 8pm to 12am and so forth. Can't seem to crack the formula here, I assumed doing a vlookup would do the trick but maybe the times are not in the correct format. Not sure, any help would be greatly appreciated.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Please show us a sample of your data and expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
here's a couple of possible solutions
------------
Book1
ABCDE
29:00:00 AM9:01:00 AMEMif
34:00:00 PM9:01:00 AMEMifs
48:00:00 PM
512:00:00 AM
Sheet2
Cell Formulas
RangeFormula
D2D2=IF(AND(C2>=$A$2,C2<$A$3),"EM",IF(AND(C2>=$A$3,C2<$A$4),"EM2",IF(AND(C2>=$A$4,C2<$A$5),"EM3","EM4")))
D3D3=IFERROR(IFS(AND(C3>=$A$2,C3<$A$3),"EM",AND(C3>=$A$3,C3<$A$4),"EM2",AND(C3>=$A$4,C3<$A$5),"EM3"),"EM4")
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,948
Members
449,198
Latest member
MhammadishaqKhan

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