[Excel 2003] - IF Function using Dates & Text

Last update on November 1, 2009 09:42 AM by aakai1056
Published by aakai1056

[Excel 2003] - IF Function using Dates & Text






Issue


I'm trying to write a function for a cell which refers to a date in another cell - which if it is between 01/01/1994 and 31/12/1995 the cell will read U16, but if the date is between 01/01/1996 and 31/12/1997 it will read U14 and if the date is later than 01/01/1998, it will read U12.

Solution


Your date entry is in A1

Try this formula:

=IF(AND(A1>="1/1/94"+0,A1<="12/31/95"+0),"U16",IF(AND(A1>="1/1/96"+0,A1<="12/31/97"+0),"U14",IF(A1>=1/1/98,"U12","")))


Study this carefully so that you and create such a formula in future

Remember in excel the dates are entered as mm/dd/yy
that is 5/10/94 is 10th May 1994

Note


Thanks to venkat1926 for this tip on the forum.
Best answers for « IF Function using Dates &amp; Text » in :
Colouring cells on conditions ShowColouring cells on conditions There are many pratical functions under Excel which is not commonly used. Example: If you wish a cell automatically turns red (or other formatting border, frame etc) under one condition: a result, a...
[VBA] A function that returns the color of an active MFC Show[VBA] A function that returns the color of an active MFC This function returns the value of the active format in conditional formatting. With the function below, two values can be returned. Mode = 0: the value of Interior.ColorIndex...
[PHP]Last day of the month/Number of days in the month ShowLast day of the month and number of days in a month Using $m as the number of the month i and $y as year. Function date() can display directly the number of days in the month using the "t" character:
Download Scribes Report Builder ShowScribes Report Builder is a report generator for databases Firebird, Interbase, PostGre-Sql, Sybase, SqlLite, Mysql, Oracle, Microsoft Access, Microsoft SQL Server, Excel databases, text files or the ODBC connections. Its main features are: -...
Spreadsheet - Functions ShowThe Concept of a Function Spreadsheets generally have a large number of integrated functions for processing data. There are hundreds, categorised as follows: Arithmetic functions that offer basic tools to process numerical data Statistical...
Spreadsheets - Arithmetic Functions ShowThe Concept of a Function Spreadsheets generally have a large number of integrated functions for processing data. There are hundreds, categorised as follows: Arithmetic functions that offer basic tools to process numerical data Statistical...
Spreadsheets - Mathematical Functions ShowStandard Functions Function Description ABS() This function returns the absolute value of a number. It therefore returns the number, if it is positive, or the opposite (positive) if it is negative ODD(value) Rounds a number up to the...