Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Using the If function for a date range

Hi,
I was wondering if anyone could please help me.

I'm trying to set up a formular that says if A1 (which is a date) is between 01/01/2012-31/12/12 then B1 will say "2012".
If A1 is between 01/01/2013-31/12/2013 then B1 will say "2013" and so on.

Can anyone suggest the best way of doing this?

Thanks,

Jon.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default Using the If function for a date range

Hi Jon,

Am Wed, 30 Jan 2013 12:04:20 +0000 schrieb Jon Keym:

I'm trying to set up a formular that says if A1 (which is a date) is
between 01/01/2012-31/12/12 then B1 will say "2012".
If A1 is between 01/01/2013-31/12/2013 then B1 will say "2013" and so
on.


in B1 try:
=YEAR(A1)


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Member
 
Posts: 93
Default

Hi Jon Keym

If the date in A1 is a proper date & not text. Then the following formula in B1 should suit your requirement.

=YEAR(A1)

Quote:
Originally Posted by Jon Keym View Post
Hi,
I was wondering if anyone could please help me.

I'm trying to set up a formular that says if A1 (which is a date) is between 01/01/2012-31/12/12 then B1 will say "2012".
If A1 is between 01/01/2013-31/12/2013 then B1 will say "2013" and so on.

Can anyone suggest the best way of doing this?

Thanks,

Jon.
  #4   Report Post  
Junior Member
 
Posts: 2
Default

Quote:
Originally Posted by Kevin@Radstock View Post
Hi Jon Keym

If the date in A1 is a proper date & not text. Then the following formula in B1 should suit your requirement.

=YEAR(A1)
Works perfectly. Thanks very much.
  #5   Report Post  
Junior Member
 
Posts: 1
Default

Quote:
Originally Posted by Jon Keym View Post
Works perfectly. Thanks very much.
in future you can also refer to www.excelformulaslist.com which has explanation and examples for tons excel formulas
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
IF function and date range Hummel Guy Excel Programming 2 June 5th 09 01:25 PM
IF function and date range Gary''s Student Excel Programming 0 June 4th 09 03:03 PM
MAX figure within a date range as a function of today()'s date irvine79 Excel Worksheet Functions 6 February 20th 07 03:28 PM
SUMIF within date range as a function of today()'s date irvine79 Excel Worksheet Functions 8 August 6th 06 05:55 PM
How to use Date range function in Sum(if....) Murugan Excel Discussion (Misc queries) 3 August 4th 06 11:58 PM


All times are GMT +1. The time now is 04:47 AM.

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

About Us

"It's about Microsoft Excel"