(Year(Today())) - ((Combine(19, Left(RHBKKK._03_IC, 2))))
Which doesnt handle anyone if they're born on yr 2000 or higher, will need an if statement for that.
Wednesday, 30 September 2009
Nested IF statement for Lotus Approach
Used this to set the age group based ages.
If(RHBKKK._8_Age < 10, 'Kanak-Kanak',
(If(RHBKKK._8_Age >= 10 and RHBKKK._8_Age <= 14, 'Awal Remaja',
(If(RHBKKK._8_Age >= 15 and RHBKKK._8_Age <= 17, 'Remaja',
(If(RHBKKK._8_Age >= 18 and RHBKKK._8_Age <= 19, 'Lewat Remaja',
(If(RHBKKK._8_Age >= 20 and RHBKKK._8_Age <= 59, 'Dewasa',
(If(RHBKKK._8_Age >= 60 and RHBKKK._8_Age <= 74, 'Awal Warga Emas', 'Lewat Warga Emas'
)))))))))))
Note that the end paranthesis is 2n-1, where n= number of ifs.
If(RHBKKK._8_Age < 10, 'Kanak-Kanak',
(If(RHBKKK._8_Age >= 10 and RHBKKK._8_Age <= 14, 'Awal Remaja',
(If(RHBKKK._8_Age >= 15 and RHBKKK._8_Age <= 17, 'Remaja',
(If(RHBKKK._8_Age >= 18 and RHBKKK._8_Age <= 19, 'Lewat Remaja',
(If(RHBKKK._8_Age >= 20 and RHBKKK._8_Age <= 59, 'Dewasa',
(If(RHBKKK._8_Age >= 60 and RHBKKK._8_Age <= 74, 'Awal Warga Emas', 'Lewat Warga Emas'
)))))))))))
Note that the end paranthesis is 2n-1, where n= number of ifs.
Subscribe to:
Posts (Atom)