Help with formula

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,486
My Cell C11 is a Date (numeric) - I need to test it for any one of 3 different month ends (below)... It currently want take this.. Any pointers? Tks Jim

Code:
=IF(AND(F11="Current Period Change",OR C11={Date(2011,1,31),Date(2011,2,28),Date(2011,3,31)}),"OK","NOT")
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
it's interesting to see different approaches and functions, but do you really recommend usage like that ? (e.g. 40574,40602,40633 will not be recognizable to many people, or storing dates as texts ?)

I think that there are many lessons in these answers. The answers clarify the point Richard made about array constants needing to contain constant values only. There's one point made by me on how to create an array of date values using the date function, and another is a lesson on coercing values in an array constant. All good things that Jim could potentially use in other projects.

Personally I would go along with your suggestion and store the dates in a range, but I enjoy contributing other methods because of the other lessons that can be learned. :)
 
Upvote 0
I think that there are many lessons in these answers. The answers clarify the point Richard made about array constants needing to contain constant values only. There's one point made by me on how to create an array of date values using the date function, and another is a lesson on coercing values in an array constant. All good things that Jim could potentially use in other projects.

Personally I would go along with your suggestion and store the dates in a range, but I enjoy contributing other methods because of the other lessons that can be learned. :)

Sure.
 
Upvote 0
Jim, how do the 3 dates in the formula compare to current date?

I'm assuming (maybe incorrectly) that at some point in the future the month and year will change, so maybe you could EOMONTH and TODAY() to make it dynamic.
 
Upvote 0
I ended up using:

Code:
=IF(AND(F11="Current Period Change",OR(C11=$H$6,C11=$H$7,C11=$H$8)),"OK","NOT")

This is included in a Quartery Inventory Template I'm designing for a client.

Thanks,

Jim
 
Upvote 0

Forum statistics

Threads
1,225,151
Messages
6,183,197
Members
453,151
Latest member
Lizamaison

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top