Translate

Assignment 15 Date Function Age Calculator

 

Assignment 15

Date Function


Age Calculator


Syntax For Assignment


=IFERROR(DATEDIF(TEXT(B4,"m/dd/yyyy")&" "&TEXT(C4,"hh:mm:ss"),NOW(),"y")&"Year"&DATEDIF(TEXT(B4,"m/dd/yyyy")&"  "&TEXT(C4,"hh:mm:ss"),NOW(),"Ym")&"Month"&DATEDIF(TEXT(B4,"m/dd/yyyy")&""&TEXT(C4,"hh:mm:ss"),NOW(),"md")&"Days"&HOUR(NOW())&"Hours"&MINUTE(NOW())&"Minutes"&SECOND(NOW())&"Seconds","Please Check your Date of Birth (Format or Greater Than Today)")

Function Used


IFERROR :- this Function return a custom result when a formula generates an error and a standard result when no error is detected.

DATEDIF:- Datedif function return the difference between two date values in year, month, days.

TEXT :- The TEXT function returns a number in a specified number format as a text.

NOW :- Now function return the current date and time , update continuously when a worksheet is change or opened.

HOUR :- Hour function returns a the hour component of a number between 0-23. for example with a time of 9:30 am Hour will return 9 .

MINUTE:- The minute function extract the minute component of a time as a number between 0-59 for example with a time of 9:45 am, minute will be return 45.

SECOND :- The second function return the second component of a time as a number between 0-59 for example - with a time of 9:10:15 am, Second will return 15.


1st Datedif


DATEDIF(TEXT(B4,"m/dd/yyyy")&" "&TEXT(C4,"hh:mm:ss"),NOW(),"y")&"Year"

Note :- criteria return a "Year"


2nd Datedif


DATEDIF(TEXT(B4,"m/dd/yyyy")&" "&TEXT(C4,"hh:mm:ss"),NOW(),"Ym")&"Month"

Note :- This criteria return a "Month"


3rd Datedif


DATEDIF(TEXT(B4,"m/dd/yyyy")&""&TEXT(C4,"hh:mm:ss"),NOW(),"md")&"Days"

Note :- This criteria return a "Days"


Hour Function

HOUR(NOW())&"Hours"


This is return for hour.

Minute Function

MINUTE(NOW())&"Minutes"

This is return for minute

Second Function


SECOND(NOW())&"Seconds"

This is return for second


Note :-


Make Age calculator by using any function you need without VBA.

Post a Comment

0 Comments