Results 1 to 6 of 6

Help with a Fibonacci function

Threaded View

chipp300 Help with a Fibonacci function 12-22-2014, 07:01 PM
shg Re: Help with a Fibonacci... 12-22-2014, 07:42 PM
chipp300 Re: Help with a Fibonacci... 12-22-2014, 08:06 PM
martindwilson Re: Help with a Fibonacci... 12-22-2014, 08:22 PM
shg Re: Help with a Fibonacci... 12-22-2014, 08:28 PM
chipp300 Re: Help with a Fibonacci... 12-22-2014, 11:20 PM
  1. #1
    Registered User
    Join Date
    12-15-2014
    Location
    USA
    MS-Off Ver
    2013
    Posts
    11

    Help with a Fibonacci function

    Hello everyone

    I have figured out how to write a program to produce the nth Fibonacci number, but now I want to figure out a way to find the sum of all odd Fibonacci numbers less than one million. This is my working Fibonacci program:
    Public Function GetFibonacciSequence(lnInput As Long) As Long
    Dim Fib0 As Long
    Dim Fib1 As Long
    Dim Sum As Long
    Dim n As Long
    Fib 0 = 0
    Fib 1 = 1
    For n = 1 to lnInput
    
    Sum = Fib0 + Fib1
    Fib0 =Fib1
    Fib1 = Sum
    Next
    GetFibonacciSequence = Fib0
    How can I rewrite this function to find the sum of all odd Fibonacci numbers less than one million? As long as I can print it out to the immediate window is all I really need. Any assistance is greatly appreciated. Thank you!
    Last edited by Leith Ross; 12-22-2014 at 07:50 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Fibonacci function/command in excel?...tia sal
    By JE McGimpsey in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  2. [SOLVED] Fibonacci function/command in excel?...tia sal
    By in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  3. [SOLVED] Fibonacci function/command in excel?...tia sal
    By in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  4. Fibonacci function/command in excel?...tia sal
    By in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-05-2005, 11:05 PM
  5. [SOLVED] Fibonacci function/command in excel?...tia sal
    By in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-07-2005, 02:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1