# Formula with array constant

#### searchsolution

##### New Member
I am having trouble to get a solution for creating a formula to calculate with an array constant and then tell me if the calculated amounts equal a designated amount. This is what I have so far:

=IF(SUM(YEAR(A2)+{5;10;15;20;25;30;35;40;45;50})=YEAR(TODAY());"jubilee";"")

Can anyone help quickly?

### Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

#### Rick Rothstein

##### MrExcel MVP
I am having trouble to get a solution for creating a formula to calculate with an array constant and then tell me if the calculated amounts equal a designated amount. This is what I have so far:

=IF(SUM(YEAR(A2)+{5;10;15;20;25;30;35;40;45;50})=YEAR(TODAY());"jubilee";"")

Can anyone help quickly?

You will need to explain in words what you think that formula should be doing. One of my main questions is are the number in the array years or days?

#### searchsolution

##### New Member
the formula should be checking if the value for the current year can be found within the calculated values of the array. The numbers within the array are multiples of 5 indicating the jubilee increments.

Ex: entry date 01.01.2004 / jubilee date: 2009, 2014, 2019, ...

#### searchsolution

##### New Member
I have found the solution!

=IF(OR(YEAR(TODAY())=(YEAR(A2)+{5;10;15;20;25;30;35;40;45;50}));"jubilee";"")

thx anyhow Rick!

#### Rick Rothstein

##### MrExcel MVP

I have found the solution!

=IF(OR(YEAR(TODAY())=(YEAR(A2)+{5;10;15;20;25;30;35;40;45;50}));"jubilee";"")

thx anyhow Rick!
You did not find "the solution", you found "a solution". Just in case you are interested, here is a shorter formula that will work (without the need for an array) for any year from 1900 up to 9999...

=IF(MOD(YEAR(TODAY())-YEAR(A2),5),"","Jubillee")

#### searchsolution

##### New Member
Hi Rick, yes, it was one of maybe many solutions. Naturally the best solution is the most concise and simple. I tried out your solution as well and it worked. The only challenge would be if the service entry date is the actual year, then your solution would also indicate "jubilee" even though the employee had only started in the current year. I will definitely check out how I can use your solution to make it only work for every five years. Thx again and I certainly appreciate the support!

#### Rick Rothstein

##### MrExcel MVP
Hi Rick, yes, it was one of maybe many solutions. Naturally the best solution is the most concise and simple. I tried out your solution as well and it worked. The only challenge would be if the service entry date is the actual year, then your solution would also indicate "jubilee" even though the employee had only started in the current year. I will definitely check out how I can use your solution to make it only work for every five years. Thx again and I certainly appreciate the support!

Ah, you only want to examine years prior to today. Then I guess this modification would work (but now my formula is getting longer, although it avoids the array and covers more years than that array did)...

=IF(OR(YEAR(A2)>=YEAR(TODAY()),MOD(YEAR(TODAY())-YEAR(A2),5)),"","Jubillee")

Last edited:

#### searchsolution

##### New Member
exactly what i worked out as well! I must be on the best path though I never thought of using "mod" as a possibility, because I have never been exposed to it before. I need more challenges and better understanding of the various functions. Search ended

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,167,817
Messages
5,855,806
Members
431,765
Latest member
RedleoUK

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back