# Formula Hell, ...OK, maybe just Formula Heck.

#### jeh

##### Active Member
Hi Gang,

This part of my formula work like it should;
=IF(C3>37346,"invalid date","")

I cant figure out how to make the second part work "<37527"

What I'm looking for is =IF(C3>3734OR<37527,"invalid date","")

I cant seem to make it go. Any ideas?

Jim

### Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
This should work.

=IF(AND(C3>1,C3<4),"invalid date","")

=IF(OR(C3>37346,C3<37527),"Invalid Date","")

This message was edited by TsTom on 2002-08-29 00:00

On 2002-08-28 23:58, TsTom wrote:

=IF(OR(C3>37346,C3<37527),"Invalid Date","")

This message was edited by TsTom on 2002-08-29 00:00

Won't all dates be either greater than 37346 or less than 37527, in which case they will all be invalid? I think the OP meant if the date falls between the dates, it is invalid, in which case AND would be the correct usage. Please correct me if I'm wrong.

Richard

Thanks Everyone,

I guess I should explain my train wreck a little better. If the dates fall between the two numbers, then the date is valid, if its greater or less than the two numbers, it's invalid.

Thanks

Flip the comparison operators:

=IF(OR(C3<37346,C3>37527),"Invalid Date","")
If less than 3/31/2002 OR greater than 9/28/2002...

Most date searches include the beginning and ending dates. Depends on what the OP wants?
Probably:
=IF(AND(C3>=37346,C3<=37527),"Invalid Date","")

Tom

All you have to do rearrange the code Flenley gave you so it read like this.

<pre>
=IF(AND(C3>37346,C3<37527),"valid","invalid date")
</pre>

Thanks Very much,

Burning the 03:30 oil TsTom?

Jim

I was wrong.
Looking at the Opost now, I'm not too sure exactly what they want?
Tom

I work nights and am off tonight.
This message was edited by TsTom on 2002-08-29 00:27

Then swap your signs around in Toms,

=IF(OR(C3<37346,C3>37524),"Invalid Date","")

If date is between March 31 and September 28 inclusive, it returns nothing, otherwise Invalid Date.

Richard

Replies
2
Views
217
Replies
0
Views
158
Replies
3
Views
657
Replies
1
Views
157
Replies
13
Views
354

1,219,004
Messages
6,145,701
Members
450,635
Latest member
Rookie3510

### 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.

### Which adblocker are you using?

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

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