+ Reply to Thread
Results 1 to 4 of 4

VBA Model : Two Stage Gordon Model

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    Al Khobar, Saudi Arabia
    MS-Off Ver
    Excel 2010-2013
    Posts
    47

    VBA Model : Two Stage Gordon Model

    Hi....i am a student using financial modelling in excel and i have come across a problem when i used a code for calculating the cost of equity using two stage gordon model. Please help......the error is #NAME#...
    THIS IS THE CODE
    Function TwoStageGordon(P0, Div0, Highgrowth, Highgrowthyrs, Normalgrowth)
    High = 4
    Low = 0

    Do While (High - Low) > 0.0000001
    Estimate = (High + Low) / 2
    factor = (1 + Highgrowth) / (1 + Estimate)
    Term1 = Div0 * factor * (1 - factor ^ Highgrowthyrs) / _
    (1 - factor)
    Term2 = Div0 * factor ^ Highgrowthyrs * _
    (1 + Normalgrowth) / (Estimate - Normalgrowth)
    If (Term1 + Term2) > P0 Then
    Low = (High + Low) / 2
    Else: High = (High + Low) / 2
    End If
    Loop
    TwoStageGordon = Estimate
    End Function

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA Model : Two Stage Gordon Model

    Where is the code located? It must be in a normal module in that workbook (or an add-in), and you must have macros enabled.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    Al Khobar, Saudi Arabia
    MS-Off Ver
    Excel 2010-2013
    Posts
    47

    Re: VBA Model : Two Stage Gordon Model

    The code is copied from a notepad file and is pasted in an user module of that workbook.

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,803

    Re: VBA Model : Two Stage Gordon Model

    I seem to recall others having #Name? errors caused by naming conflicts. Most common seems to be to give the function and the module containing the function the same name.

    Also, you might note that this forum can be pretty strict about putting code inside of [code] tags. You may want to edit your original post so that the topic doesn't get locked.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] N/a
    By doglover in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2013, 09:02 AM
  2. Create a model that will generate a column of numbers based on model parameters
    By tncanoeguy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2013, 05:47 PM
  3. Predictive Model Help
    By jbiker in forum Excel General
    Replies: 0
    Last Post: 07-10-2012, 08:09 PM
  4. Need Some Help With a Dynamic Model
    By nadnerb in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-09-2012, 10:34 AM
  5. sum the same model + same side + same #
    By ttik in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2008, 01:30 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