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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,213,536
Messages
6,114,207
Members
448,554
Latest member
Gleisner2

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