Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default A formula that's different on every row

Bear with me here...

I have a sheet that is several thousand lines long with all the
inventory held in a particular bank account. Several of the columns
are formulas that contain an FX rate, and which rate to use depends on
the currency on the current line compared to the account.

If the currency is the same as the bank account's, I can just replace
the rate with "1". If it's a CAD holding in a USD account, then I want
to replace it with "0.97". If it's USD holding in a CAD account, I
want to use "1.03".

I've found that Excel seems to be much faster if you apply a single
formula to a range (column-by-column in this case) than looping over
the rows and putting a formula in each one one-by-one (perhaps this is
not true?).

So what I thought is that I should put in a placeholder of some sort,
something in the formula that I can just search and replace. Like
this...

"=(E5*F5*BE5)*FXRATE"

But it can't just say "FXRATE", it has to say something like
"FXRATEUSD" so I know what number to replace it with. For the life of
me I can't figure out how to write that formula. It's just a string
concat, right?

Any advice? Or should I just punt and roll over the rows in a loop?

Maury
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default A formula that's different on every row

Can you give us a little more detail about the structure of your worksheet?
For example, where is the currency for the bank account and for the holdings
kept and how are they indicated? Where is the FX rate stored at and what
does its structure look like? We are probably talking about incorporating a
lookup function of some kind for what you are calling FXRATE, but without
more detail regarding the structure of your worksheet, I'm not sure anyone
will be able to give you a more detailed response.

Rick


"Maury Markowitz" wrote in message
...
Bear with me here...

I have a sheet that is several thousand lines long with all the
inventory held in a particular bank account. Several of the columns
are formulas that contain an FX rate, and which rate to use depends on
the currency on the current line compared to the account.

If the currency is the same as the bank account's, I can just replace
the rate with "1". If it's a CAD holding in a USD account, then I want
to replace it with "0.97". If it's USD holding in a CAD account, I
want to use "1.03".

I've found that Excel seems to be much faster if you apply a single
formula to a range (column-by-column in this case) than looping over
the rows and putting a formula in each one one-by-one (perhaps this is
not true?).

So what I thought is that I should put in a placeholder of some sort,
something in the formula that I can just search and replace. Like
this...

"=(E5*F5*BE5)*FXRATE"

But it can't just say "FXRATE", it has to say something like
"FXRATEUSD" so I know what number to replace it with. For the life of
me I can't figure out how to write that formula. It's just a string
concat, right?

Any advice? Or should I just punt and roll over the rows in a loop?

Maury


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default A formula that's different on every row

From how you describe this I would either:

Add a new column with the FX Rate to use, then the formula multiplies the
new column. Then all of the logic can go into the FX Rate To Use formula and
not in the key metric.

Extend the key metric to include all of the possible FX Rates. Make the
formula more sophisticated so that you can fill it down for new rows and it
will work without find/replace.


--
Tim Zych
www.higherdata.com
Compare data in worksheets and find differences with Workbook Compare
A free, powerful, flexible Excel utility


"Maury Markowitz" wrote in message
...
Bear with me here...

I have a sheet that is several thousand lines long with all the
inventory held in a particular bank account. Several of the columns
are formulas that contain an FX rate, and which rate to use depends on
the currency on the current line compared to the account.

If the currency is the same as the bank account's, I can just replace
the rate with "1". If it's a CAD holding in a USD account, then I want
to replace it with "0.97". If it's USD holding in a CAD account, I
want to use "1.03".

I've found that Excel seems to be much faster if you apply a single
formula to a range (column-by-column in this case) than looping over
the rows and putting a formula in each one one-by-one (perhaps this is
not true?).

So what I thought is that I should put in a placeholder of some sort,
something in the formula that I can just search and replace. Like
this...

"=(E5*F5*BE5)*FXRATE"

But it can't just say "FXRATE", it has to say something like
"FXRATEUSD" so I know what number to replace it with. For the life of
me I can't figure out how to write that formula. It's just a string
concat, right?

Any advice? Or should I just punt and roll over the rows in a loop?

Maury



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula PJ[_3_] Excel Worksheet Functions 2 June 2nd 10 03:45 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Excel 2002 formula displayed not value formula option not checked Dean Excel Worksheet Functions 1 February 28th 06 02:31 PM
Cell doesn't show formula result - it shows formula (CTRL + ' doe. o0o0o0o Excel Worksheet Functions 6 November 19th 04 03:13 PM
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 06:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"