Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

If Function and Dates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Laura Logan - 11 Mar 2008 20:07 GMT
I am trying to create a function in a spreadsheet but not sure how to go
about it.  I have a start date in A1 and and end date in B1.  If column c1
falls between those dates, I want to have the cell in D1 enter the value of
1.  If c2 does not fall between those dates, then I want it to enter the
value of 0.  Can this be done?
Signature

Laura

Ron Coderre - 11 Mar 2008 20:11 GMT
With
A1: (a start date)
B1: (an end date)
C1: (a date)

This formula returns 1 if C1 is between A1 and B1, inclusive:
D1: =--(MEDIAN(A1:C1)=C1)

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

>I am trying to create a function in a spreadsheet but not sure how to go
> about it.  I have a start date in A1 and and end date in B1.  If column c1
> falls between those dates, I want to have the cell in D1 enter the value
> of
> 1.  If c2 does not fall between those dates, then I want it to enter the
> value of 0.  Can this be done?
Laura Logan - 11 Mar 2008 20:43 GMT
Thanks Ron.  That did the trick.
Signature

Laura

> With
> A1: (a start date)
[quoted text clipped - 20 lines]
> > 1.  If c2 does not fall between those dates, then I want it to enter the
> > value of 0.  Can this be done?
Laura Logan - 11 Mar 2008 20:12 GMT
Sorry, question should read:

I am trying to create a function in a spreadsheet but not sure how to go
about it. I have a start date in A1 and and end date in B1. If column c1
falls between those dates, I want to have the cell in D1 enter the value of
1. If c1 does not fall between those dates, then I want it to enter the
value of 0. Can this be done?
Signature

Laura

> I am trying to create a function in a spreadsheet but not sure how to go
> about it.  I have a start date in A1 and and end date in B1.  If column c1
> falls between those dates, I want to have the cell in D1 enter the value of
> 1.  If c2 does not fall between those dates, then I want it to enter the
> value of 0.  Can this be done?
Tyro - 11 Mar 2008 23:03 GMT
Perhaps this is easier to understand rather than that obfuscated formula.

=IF(AND(C1>=A1,C1<=B1),1,0)

Tyro

>I am trying to create a function in a spreadsheet but not sure how to go
> about it.  I have a start date in A1 and and end date in B1.  If column c1
> falls between those dates, I want to have the cell in D1 enter the value
> of
> 1.  If c2 does not fall between those dates, then I want it to enter the
> value of 0.  Can this be done?
Pete_UK - 12 Mar 2008 00:53 GMT
How about this:

=AND(C1>=A1,C1<=B1)*1

Obfuscated enough ?

Pete

> Perhaps this is easier to understand rather than that obfuscated formula.
>
[quoted text clipped - 9 lines]
>> 1.  If c2 does not fall between those dates, then I want it to enter the
>> value of 0.  Can this be done?
Tyro - 12 Mar 2008 01:19 GMT
Apply the KISS principle, just keep it simple

Tyro

> How about this:
>
[quoted text clipped - 17 lines]
>>> 1.  If c2 does not fall between those dates, then I want it to enter the
>>> value of 0.  Can this be done?
Tyro - 12 Mar 2008 01:20 GMT
You have really no understanding of simple things. The more obfuscated it
is, the better for the learner.
I can give you obfuscated things that would blow your socks off. But to
whose benefit?

Tyro

> How about this:
>
[quoted text clipped - 17 lines]
>>> 1.  If c2 does not fall between those dates, then I want it to enter the
>>> value of 0.  Can this be done?
Pete_UK - 12 Mar 2008 01:38 GMT
Well, the OP here thanked Ron for his formula, so presumably she
understood it in the end. Sometimes it is better to stretch knowledge
in order for the learner to gain a better understanding of the
solution.

Pete

> You have really no understanding of simple things. The more obfuscated it
> is, the better for the learner.
[quoted text clipped - 28 lines]
>
> - Show quoted text -
Tyro - 12 Mar 2008 01:55 GMT
I disagree entirely. The OP needs to learn the simple things, complicated
(obfuscation) will come with time.
After 44 years of computer programming, I truly believe in keeping it
simple.
I can obfuscate to the point that most programmers will say what is this
that works?

Tyro

Well, the OP here thanked Ron for his formula, so presumably she
understood it in the end. Sometimes it is better to stretch knowledge
in order for the learner to gain a better understanding of the
solution.

Pete

On Mar 12, 12:20 am, "Tyro" <T...@hotmail.com> wrote:
> You have really no understanding of simple things. The more obfuscated it
> is, the better for the learner.
[quoted text clipped - 36 lines]
>
> - Show quoted text -
Sandy Mann - 12 Mar 2008 12:17 GMT
> After 44 years of computer programming,

Your apparent need to keep telling us how long you have been in computing
makes you sound very under confident.  I've been driving for 49 years - but
it doesn't make me Lewis Hamilton.

Signature

Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk

>I disagree entirely. The OP needs to learn the simple things, complicated
>(obfuscation) will come with time.
[quoted text clipped - 53 lines]
>>
>> - Show quoted text -
Ron Coderre - 12 Mar 2008 12:30 GMT
Hey! How'bout them Red Sox, eh?

Respectfully,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

>> After 44 years of computer programming,
>
[quoted text clipped - 62 lines]
>>>
>>> - Show quoted text -
Sandy Mann - 12 Mar 2008 12:54 GMT
You're talking to Limey here Ron - I'm afraid that that goes right over my
head.

Signature

Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

sandymann2@mailinator.com
Replace @mailinator.com with @tiscali.co.uk

> Hey! How'bout them Red Sox, eh?
>
[quoted text clipped - 74 lines]
>>>>
>>>> - Show quoted text -
Pete_UK - 12 Mar 2008 14:31 GMT
Unless he means Liverpool last night in the San Siro !! <bg>

Pete

> You're talking to Limey here Ron - I'm afraid that that goes right over my
> head.
[quoted text clipped - 99 lines]
>
> - Show quoted text -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.