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.
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.
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?
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
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?
=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.
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?
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
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"?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks