#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Date Question

In row A I have dates 31-Jan-08, 28-Feb-08, 31-Mar-08...etc.

In row B I want an =IF function such that a certain formula will apply if
the date is 31st December, regardless of the year.

Can anyone tell me how to refer to the date in such a funtion? i.e.
=IF(A1=?????,25*3,25*4) if A1 is 31-Dec-** then 25 times 3, otherwise 25
times 4.

Many thanks for any help

Andrew


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 50
Default Date Question

Thanks all for a comprehensuive and speedy reply (it was obviously easier
than I thought!).


"Andrew Mackenzie" wrote in message
...
In row A I have dates 31-Jan-08, 28-Feb-08, 31-Mar-08...etc.

In row B I want an =IF function such that a certain formula will apply if
the date is 31st December, regardless of the year.

Can anyone tell me how to refer to the date in such a funtion? i.e.
=IF(A1=?????,25*3,25*4) if A1 is 31-Dec-** then 25 times 3, otherwise 25
times 4.

Many thanks for any help

Andrew




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Date Question

One way:

=25*(3 + (MONTH(A1)=12)*(DAY(A1)=31))

In article ,
"Andrew Mackenzie" wrote:

In row A I have dates 31-Jan-08, 28-Feb-08, 31-Mar-08...etc.

In row B I want an =IF function such that a certain formula will apply if
the date is 31st December, regardless of the year.

Can anyone tell me how to refer to the date in such a funtion? i.e.
=IF(A1=?????,25*3,25*4) if A1 is 31-Dec-** then 25 times 3, otherwise 25
times 4.

Many thanks for any help

Andrew

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Date Question

One way

=IF(AND(MONTH(A1)=12,DAY(A1)=31),75,100)



--


Regards,


Peo Sjoblom


"Andrew Mackenzie" wrote in message
...
In row A I have dates 31-Jan-08, 28-Feb-08, 31-Mar-08...etc.

In row B I want an =IF function such that a certain formula will apply if
the date is 31st December, regardless of the year.

Can anyone tell me how to refer to the date in such a funtion? i.e.
=IF(A1=?????,25*3,25*4) if A1 is 31-Dec-** then 25 times 3, otherwise 25
times 4.

Many thanks for any help

Andrew




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Date Question

=IF(AND(DAY(A1)=31,MONTH(A1)=12),25*3,25*4)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Andrew Mackenzie" wrote in message
...
In row A I have dates 31-Jan-08, 28-Feb-08, 31-Mar-08...etc.

In row B I want an =IF function such that a certain formula will apply if
the date is 31st December, regardless of the year.

Can anyone tell me how to refer to the date in such a funtion? i.e.
=IF(A1=?????,25*3,25*4) if A1 is 31-Dec-** then 25 times 3, otherwise 25
times 4.

Many thanks for any help

Andrew




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Date Question

One mo
=if(text(a1,"mmdd")="1231",25*3,25*4)

and another:
=25*(4-(TEXT(A1,"mmdd")="1231"))

This portion:
(TEXT(A1,"mmdd")="1231")
will return true or false. But when excel subtracts it from 4, it'll see
true/false as 1 or 0.



Andrew Mackenzie wrote:

In row A I have dates 31-Jan-08, 28-Feb-08, 31-Mar-08...etc.

In row B I want an =IF function such that a certain formula will apply if
the date is 31st December, regardless of the year.

Can anyone tell me how to refer to the date in such a funtion? i.e.
=IF(A1=?????,25*3,25*4) if A1 is 31-Dec-** then 25 times 3, otherwise 25
times 4.

Many thanks for any help

Andrew


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Date Question

I hope you mean =25*(4 - (MONTH..., rather than =25*(3 + (MONTH... ?
--
David Biddulph

"JE McGimpsey" wrote in message
...
One way:

=25*(3 + (MONTH(A1)=12)*(DAY(A1)=31))

In article ,
"Andrew Mackenzie" wrote:

In row A I have dates 31-Jan-08, 28-Feb-08, 31-Mar-08...etc.

In row B I want an =IF function such that a certain formula will apply if
the date is 31st December, regardless of the year.

Can anyone tell me how to refer to the date in such a funtion? i.e.
=IF(A1=?????,25*3,25*4) if A1 is 31-Dec-** then 25 times 3, otherwise 25
times 4.

Many thanks for any help

Andrew



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date question Jman Excel Worksheet Functions 8 June 1st 07 10:43 AM
Date question [email protected] Excel Worksheet Functions 2 September 2nd 06 10:14 PM
Date Question scwilly Excel Worksheet Functions 3 April 26th 06 09:24 AM
Date question Bri Excel Worksheet Functions 2 February 8th 06 02:36 AM
Date Question John Excel Discussion (Misc queries) 4 January 15th 06 06:33 PM


All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"