Assign a number value to a Date in Excel

samwong

New Member
Joined
Dec 14, 2017
Messages
1
Hi

How should I use IF or IFS function to deal with the situation below. Many thanks!

I would to assign the number "1" for the age group of 1960s, "2" for the 1970s and "3" for the 1980s.

Current data:

DateAge Group
1/1/1960
31/12/1969
1/1/1970
31/12/1979
1/1/1980
31/12/1989

<tbody>
</tbody>

Proposed result:

DateAge Group
1/1/19601
31/12/19691
1/1/19702
31/12/19792
1/1/19803
31/12/19893

<tbody>
</tbody>
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
2 formula alternatives that you can try.
Copy or fill the formulas down.


Excel 2010
ABCDEF
120-Dec-5200
220-Dec-621100
320-Dec-70221-Jan-601
431-Dec-89331-Jan-702
514-Dec-17001-Jan-803
61-Jan-900
7
2c
Cell Formulas
RangeFormula
B1=LOOKUP(A1,$E$2:$F$6)
C1=IF(A1>=32874,0,IF(A1>=29221,3,IF(A1>=25569,2,IF(A1>=21916,1,0))))
A5=TODAY()
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,487
Members
448,967
Latest member
visheshkotha

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