+ Reply to Thread
Results 1 to 7 of 7

Underlying Value

Hybrid View

  1. #1
    Registered User
    Join Date
    06-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Underlying Value

    How do I have an underlying number in a cell while displaying a name of something? For example I want a cell to display CAD and have the underlying value be the exchange rate of the canadian dollar so I can mulitply it by other cells. Thanks.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Underlying Value

    If your currency is in column A and amount in B, you can set up a table of exchange rates and name it (I called it ExRates) See attachment

    And then in C2

    =VLOOKUP(A2,ExRates,2,FALSE) * B2
    Does that work for you?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    06-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Underlying Value

    Thanks. And lets say I wanted to have every time "CAD" was in column A, for it to show a value of something in the adjacent column A2. How could I do that?

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Underlying Value

    =VLOOKUP(A2,ExRates,2,FALSE)

    or
    =IF(ISERROR(VLOOKUP(A2,ExRates,2,FALSE)),"", VLOOKUP(A2,ExRates,2,FALSE))

    You could also use VBA to input the value into B2 and have the exchange rates hardcoded into the VBA script or also use the Lookup table.

  5. #5
    Registered User
    Join Date
    06-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Underlying Value

    How about if I wanted to say, for every time the word "CAD" was in one column, in the adjacent column it would display a specific formula I could write?

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Underlying Value

    I'm starting to lose the concept of what you are trying to achieve with this. An example workbook with what and where you'd be entering and what you expect as a result might help.

    This VBA code (in worksheet module) will enter the formula of your choosing into column B when CAD is entered into Col A
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 1 And Target.Value = "CAD" Then
        Target.Offset(0, 1).Formula = "=C2*5"     'Specific formula here appears in Column B
    End If
    End Sub

  7. #7
    Registered User
    Join Date
    06-15-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: Underlying Value

    I'm having a little bit of trouble with the VBA. I have one column, F, which has abbreviations for various currencies on it. They are all spread out over 15k ish lines, so if I want to display the rate for each different currency, I'd have find each abbreviation and then copy and paste it in column G next to it. Is there an easier way where I can say "for everytime there is "X" in column F, show "Y" in the adjacent cell in column G"?

+ 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