Display User's age

How do I get the date of birth of a user to calculate and display the user’s age?

I use a formula like this in the sheet where A2:A just checks if the row is populated and M2:M is the column that contains the date of birth:
=ARRAYFORMULA(IF(LEN(A2:A) = 0, "", "**Age:** " & IF(M2:M = "", "", DATEDIF(M2:M, TODAY(), "Y"))))

My mind is a bit blown right now. LOL. So A2 and M2 are cells on the spreadsheet?

Whats the A and M then?
Can you send a screen shot or something of what you did?

Then how do you display it?

Thanks

So the whole formula goes into one cell?

You can start out simpler and use =DATEDIF(M2, TODAY(), “Y”) but you would have to put the formula in each row. Eventually you will find that arrayformula’s work much better. I recommend reading up on how arrayformulas work.

I’m assuming that you would place the formula on row 2. That is the only place you would need put the formula. All of the following rows will automatically apply the formula. The A2:A tells the formula to start at column A row 2 and apply the formula down the entire A column.

I’m displaying the age in my app as part of a bunch of markdown. It might be confusing to show you all of that. You can you a basic text or rich text to display the value.

Cool thanks. I will read up on it first.

1 Like

Learned ARRAYFORMULA. It worked.

You’re a genius
Thanks again

2 Likes