Date Calculation

C

caros

Can anyone help.

I am trying to do a calculation in a cell based on dates.

A1 data is the person's birthdate in dd/mm/yyyy format.
B1 data is a start date
C1 data is an end date
D1 is the calculation and states "Birthday" if the month and day par
of the date in A1 is between B1 & C1. If not the field should be blan
or could state "Not Birthday".

For example
A1 = 13/04/1977
B1 = 01/04/2004
C1 = 20/04/2004
D1 result = "Birthday"

Hope this makes sense, appreciate any assistance.


Carolin
 
F

Frank Kabel

Hi
one way: enter the following in D1
=IF(AND(DATE(YEAR(C1),MONTH(A1),DAY(A1))>=B1,DATE(YEAR(C1),MONTH(A1),DA
Y(A1))<=C1),"Birthday","")
 
N

Norman Harker

Hi Caros!

Here's one way:
=IF(AND(MONTH(A1)=MONTH(B1),MONTH(A1)=MONTH(C1),DAY(A1)>=DAY(B1),DAY(A1)<=DAY(C1)),"Birthday","No
Birthday")

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
C

caros

Thank you, this is excellent and does exactly what I need.

I can't believe how quickly i got a response, brilliant.

Very much appreciated.


Carolin
 
N

Norman Harker

Hi Caros!

Always pleased to help and thanks shows Google searchers that the
answer works.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top