Skip to main content
Solved

How to get automatic todays year into a formula


I am running a membership organization, we have “Member Since” that is a year, e.g 2014, 2018, etc.
I want to calculate on a column to the right, how many years they have been member.
Something in simple words like =TODAYS YEAR - “Member Since” (in the picture it is “PGM Since”)
So that this adapts to every year. Otherwise I can just keep it to =2020-“Member Since”
Anybody can help with that? :smiley:

How to get automatic todays year into a formula

Best answer by kuovonne

EYES_Internatio wrote:

Thanks for your follow up! I think this is sufficient: https://airtable.com/shryQPChJB9SecTwW

It still does not work in here as well.


Thank you for the shared link to your table.

  • Have you changed the names of your fields since your original screen capture? If so, make sure that you adjust the formula to reflect the current names of your fields.

  • If you have a formula field with just the first part of the formula YEAR(TODAY()) does it work?

  • Originally your year was a lookup field. Formula fields sometimes have unexpected results with lookup values. Sometimes converting the lookup value into a string and then back into a number helps:

    YEAR(TODAY()) - VALUE({PGM (YEAR)} & "")
    
  • If none of these suggestions help, I recommend contacting customer support.

View original
Did this topic help you find an answer to your question?

7 replies

ScottWorld
Forum|alt.badge.img+33
  • Brainy
  • 8796 replies
  • August 25, 2020

Try this formula:

YEAR(TODAY())-{PGM SINCE}


  • Author
  • Participating Frequently
  • 8 replies
  • August 26, 2020
ScottWorld wrote:

Try this formula:

YEAR(TODAY())-{PGM SINCE}


Unfortunately it does not work, it says error. :frowning: The column PGM Since, is a “number” not a “date” maybe that why?

We have the specific date, but not for all our members, since we just switched to a new more comprehensive data tracking system. So I prefer using just the yearto at least get somewhat of an idea how long they have been members.

Thanks though! I hope someone else can give me some options that could work!


ScottWorld
Forum|alt.badge.img+33
  • Brainy
  • 8796 replies
  • August 26, 2020
EYES_Internatio wrote:

Unfortunately it does not work, it says error. :frowning: The column PGM Since, is a “number” not a “date” maybe that why?

We have the specific date, but not for all our members, since we just switched to a new more comprehensive data tracking system. So I prefer using just the yearto at least get somewhat of an idea how long they have been members.

Thanks though! I hope someone else can give me some options that could work!


The formula definitely works, so I’m not sure what’s going on with the error.


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6002 replies
  • August 26, 2020

There must be something else going on in your base that is preventing @ScottWorld’s formula from working. Can you provide a few more screen captures or share your base?


  • Author
  • Participating Frequently
  • 8 replies
  • August 27, 2020
kuovonne wrote:

There must be something else going on in your base that is preventing @ScottWorld’s formula from working. Can you provide a few more screen captures or share your base?


Thanks for your follow up! I think this is sufficient: https://airtable.com/shryQPChJB9SecTwW

It still does not work in here as well.


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6002 replies
  • Answer
  • August 27, 2020
EYES_Internatio wrote:

Thanks for your follow up! I think this is sufficient: https://airtable.com/shryQPChJB9SecTwW

It still does not work in here as well.


Thank you for the shared link to your table.

  • Have you changed the names of your fields since your original screen capture? If so, make sure that you adjust the formula to reflect the current names of your fields.

  • If you have a formula field with just the first part of the formula YEAR(TODAY()) does it work?

  • Originally your year was a lookup field. Formula fields sometimes have unexpected results with lookup values. Sometimes converting the lookup value into a string and then back into a number helps:

    YEAR(TODAY()) - VALUE({PGM (YEAR)} & "")
    
  • If none of these suggestions help, I recommend contacting customer support.


  • Author
  • Participating Frequently
  • 8 replies
  • August 28, 2020
kuovonne wrote:

Thank you for the shared link to your table.

  • Have you changed the names of your fields since your original screen capture? If so, make sure that you adjust the formula to reflect the current names of your fields.

  • If you have a formula field with just the first part of the formula YEAR(TODAY()) does it work?

  • Originally your year was a lookup field. Formula fields sometimes have unexpected results with lookup values. Sometimes converting the lookup value into a string and then back into a number helps:

    YEAR(TODAY()) - VALUE({PGM (YEAR)} & "")
    
  • If none of these suggestions help, I recommend contacting customer support.


YEAR(TODAY()) - VALUE({PGM (YEAR)} & “”) worked!! :grinning_face_with_big_eyes:

Thank you so much!

The original was not a look up :slightly_smiling_face:


Reply