Formula for year


#1

How do I create a formula to add only the year in primary column? I am using Datetime_Format (Date, ‘YYYY’)


#2

It looks like you are using the correct formula. If you primary field is a Formula field, then it should look like this when properly formatted in the field options:

DATETIME_FORMAT(Date,'YYYY')

#3

You also have the YEAR() function, simpler.


#4

Do I just enter it into the formula as YEAR ()?
Dana Hiatt, LPC
Licensed Professional Counselor
Mitigation Specialist
2025 Jefferson Oaks Dr
Rural Hall, NC 27045
M (336) 986-2257
F (704) 220-0694
danaahiatt@gmail.com

This electronic mail transmission may contain information that is confidential, privileged, proprietary, or otherwise legally exempt from disclosure. If you are not the intended recipient, you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this message, any part of it, or any attachments. If you have received this message in error, please delete this message and any attachments from your system without reading the content and notify the sender immediately of the inadvertent transmission. There is no intent on the part of the sender to waive any privilege that may attach to this communication. Thank you for your cooperation.


#5

When I put in Year () or DATETIME_FORMAT(Date,'YYYY’). I get #ERROR! for the entire column. It will not let me add anything to the cells in the column. Do you have any idea what I am doing wrong?

Thank you for your help,

Dana

Dana Hiatt, LPC
Licensed Professional Counselor
Mitigation Specialist
2025 Jefferson Oaks Dr
Rural Hall, NC 27045
M (336) 986-2257
F (704) 220-0694
danaahiatt@gmail.com

This electronic mail transmission may contain information that is confidential, privileged, proprietary, or otherwise legally exempt from disclosure. If you are not the intended recipient, you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this message, any part of it, or any attachments. If you have received this message in error, please delete this message and any attachments from your system without reading the content and notify the sender immediately of the inadvertent transmission. There is no intent on the part of the sender to waive any privilege that may attach to this communication. Thank you for your cooperation.


#6

Ok. I just did a test column and it works. I was entering it into the first column of the spreadsheet so maybe that was the issue.

Dana

Dana Hiatt, LPC
Licensed Professional Counselor
Mitigation Specialist
2025 Jefferson Oaks Dr
Rural Hall, NC 27045
M (336) 986-2257
F (704) 220-0694
danaahiatt@gmail.com

This electronic mail transmission may contain information that is confidential, privileged, proprietary, or otherwise legally exempt from disclosure. If you are not the intended recipient, you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this message, any part of it, or any attachments. If you have received this message in error, please delete this message and any attachments from your system without reading the content and notify the sender immediately of the inadvertent transmission. There is no intent on the part of the sender to waive any privilege that may attach to this communication. Thank you for your cooperation.


#7

Can tell me the formula to use to calculate age? I have a column with my clients date of birth and want an additional column that will show his age at the different events in his life.

Thank you for all of your help,

Dana


#8

You have DATETIME_DIFF():


#9

Spreadsheet? You mean Table? You can use Formulas in the Primary Field (first column), but you need to set it as Formula field type first :+1:


#10

Thank you for your help. I have reviewed the information below but I still do not understand the formulas. If I use DATETIME_DIFF(): Do I put the columns of each in brackets? so it would be DATETIME_DIFF({Birthday}{Event},’age’). Do I need to have DATETIME_FORMAT in front of that?

Thank you again for your help,

Dana


#11
DATETIME_DIFF(TODAY(), {Birthday}, 'years')

That should get you what you want, and will always be up to date to TODAY().


#12

Thank you. That give me his current age but I need to know the age at reach each event happened in his life. So one column has the date that the event occurred, one column has age and the other has his birthday. Do you know what I need to add to the formula to make that work? Thanks again - Dana


#13

I figured it out.

Thank you,

Dana


#14

For each one, replace TODAY() in the formula with a reference to the field that holds the Date of the event in question. So if you have a Field called “Married On” that has each person’s Marriage Date in it, then you could get the age of the person on their marriage date with this formula:

DATETIME_DIFF({Married On}, {Birthday}, 'years')