+ Reply to Thread
Results 1 to 2 of 2

User-defined formula - count cells

  1. #1
    Registered User
    Join Date
    05-12-2008
    Posts
    4

    User-defined formula - count cells

    Hi all,
    I set up a formula calculating average annual growth rate (see below).

    Period is the number of cells in the range between cells with Y0 (basis year) and Yt (current year) - the cells are in one raw and contain time series data. Currently, I have to count the number of cells by myself and enter it into the formula.

    How can I change the formula to make Excel count the number of cells?

    Thanks in advance,
    Dmitry

    Function CAGR(Yt As Variant, Y0 As Variant, Period As Variant)
    'Keyword Compound Annual Growth Rate (CAGR)
    CAGR = (Yt / Y0) ^ (1 / Period) - 1
    End Function

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,962

    Re: User-defined formula - count cells

    If Yt , Y0 & PERIOD are values passed from cells, as usual, for example,
    A1 = Y0; G1 = Yt
    and
    I1: =CAGR(G1,A1)

    Then you can calculate the period in the Fn, like:

    Please Login or Register  to view this content.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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