New Excel Forum

This forum has been moved to TeachExcel.com

Ask all future questions in the New Excel Forum.

ExcelKey

Birthday Calculations

Formulas, Functions, Formatting, Charts, Data Analysis, etc.

Birthday Calculations

Postby Ourpat1 » Tue Dec 13, 2011 5:41 pm

A simple formula, but I sometimes get rogue results.....................is it my logic.....or formatting?..........

{=OR(TEXT(ROW(INDIRECT(F1 &":"& G1)),"MD")=TEXT(E1,"MD"))}

I'm simply trying to get a "True " or "False" in the destination cell to insert a birthday(in E1) that falls between two dates in F1& G1......but now and the I get rogue answers?????

Anyone help?



Pat Savage
  • 0

Ourpat1
Rookie
 
Posts: 23
Joined: Dec 13, 2011
Reputation: 0

Re: Birtday Calculations

Postby Don » Tue Dec 13, 2011 6:43 pm

Hi, welcome to the forum!

Can you include a sample of the data you use? In this case, it might be best to include a sample worksheet that includes output that works and some with the rogue results.
  • 0

Don
Moderator
 
Posts: 733
Joined: Dec 4, 2011
Reputation: 2
Excel Version: 2010

Re: Birthday Calculations

Postby Sisyphus » Wed Dec 14, 2011 4:15 am

Hi,

Try this one: :D
Code: Select all
=AND(E1>=F1,E1<=G1)
  • 0

Last edited by Sisyphus on Thu Dec 15, 2011 3:29 am, edited 1 time in total.
Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010

Re: Birthday Calculations

Postby Ourpat1 » Wed Dec 14, 2011 3:42 pm

Sisyphus wrote:Hi,

Try this one: :D
Code: Select all
=AND(E1>=F1,E1>=F1)



The problem is with the year portion of the date, it will always be less than the two "between" dates
  • 0

Ourpat1
Rookie
 
Posts: 23
Joined: Dec 13, 2011
Reputation: 0

Re: Birthday Calculations

Postby Don » Wed Dec 14, 2011 3:44 pm

If you can include a sample of the results, one where it works and one where it doesn't, in an attached spreadsheet, it will be much easier to figure out a working solution for you.
  • 0

Don
Moderator
 
Posts: 733
Joined: Dec 4, 2011
Reputation: 2
Excel Version: 2010

Re: Birthday Calculations

Postby Sisyphus » Thu Dec 15, 2011 3:37 am

Hi,

My formula has no problem with years but it contained type which I have corrected and apologize for. Here is the corrected version again:
Code: Select all
=AND(E1>=F1,E1<=G1)

Put one date in F1, another date in G1. Write a third date in E1. Put the formula anywhere on the sheet except E1:G1. The cell that has the formula will show TRUE or FALSE depending on whether the date in E1 is between the dates in F1 and G1. Both dates are included in the range. It will work regardless of how far the dates are apart.
Regards,
  • 0

Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010

Re: Birthday Calculations

Postby Ourpat1 » Sat Dec 24, 2011 12:40 pm

Her is ome sample data withe rogue error

Pat
  • 0

You do not have the required permissions to view the files attached to this post.
Ourpat1
Rookie
 
Posts: 23
Joined: Dec 13, 2011
Reputation: 0

Re: Birthday Calculations

Postby Sisyphus » Mon Dec 26, 2011 5:02 am

Hi,
I can't find the "rogue" part of your data. Here is what I see in row 158:
04.12.07 08.01.12 04.02.12 4 4 2 1 28

Perhaps there is a problem with the formatting or regional settings. You will have noticed that all three dates are fully interchangeable as to their days, months and years. Do you copy any of these data from worksheets not prepared on your current machine? If you are looking at the same data that I see please do explain to me what's wrong.

You may like this formula for your column P:
Code: Select all
=IF(OR(H158="",N158=""),"",N158+O158)

Have a great day! :D
  • 0

Have a great day! :D

Sisyphus
I do this for "honour and country" - much less of the latter, actually.
If I helped you, award points, plenty of them.
If I bored you, deduct points for being too long-winded. (I know, :lol)
Sisyphus
Former Moderator
 
Posts: 4454
Joined: Dec 7, 2011
Location: Shanghai
Reputation: 203
Excel Version: 2010


Return to General Excel Questions

Who is online

Users browsing this forum: No registered users and 258 guests