r/excel • u/Triyambak_CA 1 • Nov 07 '22
solved Fibonacci Sequence in Excel Dynamic Formula
Fibonacci Numbers is a series of numbers where next number is found by adding two previous numbers. It starts with 0, followed by 1 and summing up 0 and 1 gives next number as 1. Now sum up previous two numbers 1 and 1 and result is is 2. Next number would be 1+2 = 3 and next would 2+3 =5 and so on..Hence, below are Fibonacci Numbers.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89…
Suppose I want to generate 10 sequence, I would put that in a cell. Value 10. And then I have a dynamic formula, it should generate 10 values that is upto 34 and if I put 12 , then upto 89 and so on and so forth.
I was trying to use makearray or sequence formula but I'm getting stuck.
If any one has any idea, then do share.
3
u/tirlibibi17 Nov 07 '22
Take a look at this: Lambda Example: Generate Fibonacci series - Microsoft Community Hub
3
u/excelevator 3071 Nov 07 '22 edited Nov 15 '23
Here is a custom VBA function to generate n range of finbonacci..
=fibonacci(10)code edited for tidy up.. see original in comment from u/JonPeltier below
1
u/Ecstatic_Sector_3996 May 28 '24
hi. (in Google Sheets) in B2 👇 "=ARRAYFORMULA(LAMBDA(n,LET(phi,(1+SQRT(5))/2,(phin-(1-phi)n)/SQRT(5)))(SEQUENCE(A2,1,0)))" and in A2 input Number you want.
1
u/Decronym May 28 '24 edited May 28 '24
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
NOTE: Decronym for Reddit is no longer supported, and Decronym has moved to Lemmy; requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
5 acronyms in this thread; the most compressed thread commented on today has 22 acronyms.
[Thread #33867 for this sub, first seen 28th May 2024, 08:08] [FAQ] [Full list] ^[Contact] [Source code]
1
u/Ecstatic_Sector_3996 May 28 '24
hi in Googlesheet in B2 cell:
=ARRAYFORMULA( LAMBDA( n , LET( phi , ( 1+ SQRT( 5 )) / 2 , ( phin - ( 1-phi )n ) / SQRT( 5 ) )) ( SEQUENCE( A2 , 1 , 0 ) ))
& in A2 input Number you want ...
1
u/Ecstatic_Sector_3996 May 28 '24