# Excel - Month value then if Date is Night or Day

I have several excel sheets each containing the same information in the same columns but need to work out a formula to determine if a time is day or night, depending on the month it is within, based on hours of daylight within the month as this will vary throughout the year in the UK.

Example
month                            time                         outcome
11/02/2013                    16:03                       Day
14/02/2013                    02:10                       Night
21/03/2013                    22:00                       Night
20/03/2013                    10:03                       Day
01/10/2014                    04:34                       Night
06/06/2013                    04:35                       Day

I need a formula to calculate if a date is a given month then using defined times within that month, decide if it is day or night depending on the time.

January for example will be darker at 5am than in August (Night) and October at 4pm will be (Night) than lets say in March (Day)

I have included an example.

Columns A,B,C has the data,  Columns H-L gives an example of the time bands I need to identify for the full year.

Ideally I need it summarising to:

Defect          Day      Night     Total
DBHS            21        10           31
DBTL             03        13           16
FLOD             00        28           28

Thanks in anticipation..
Example.xlsx
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Hi,

pls try (I've changed the Month through dates)

``````=IF(OR(C2<VLOOKUP(DATE(1900,MONTH(B2),1),\$H\$3:\$I\$14,2),C2>VLOOKUP(DATE(1900,MONTH(B2),1),\$H\$3:\$J\$14,3)),"Night","Day")
``````
Regards
EE20150902.xlsx
1

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Commented:
You can do something like this about what you are looking for..

Saurabh...
Example.xlsx
1
Author Commented:
Exactly what I was looking for, huge thanks for taking the time to respond so quickly.
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.