Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default Temp vaiables in formulas?

Here's a common example: you want a formula with a VLOOKUP which either looks
up the number you want, or returns zero if it's not in the table -- this is
so that calculations based on that formula use zero and calculate something
meaningful rather than result in #N/A!. So you have to do this:

IF(ISNA(VLOOKUP(...)),0,VLOOKUP(...))

Of course that "..." can be pretty long and hairy. And it's inefficient
too, because that long VLOOKUP has to be calculated twice. Isn't there any
way of writing a formula so it calculates the VLOOKUP once, stored the
result, and uses just the result in the rest of the formula? That is:

R=VLOOKUP(...);IF(ISNA(R),0,R)

I realize you can insert columns just to hold temporary results, and then
hide them, but when you copy them and paste them outside Excel, you get the
hidden columns too, and I don't want them.

Thanks!

--
Andy Smith
Senior Systems Analyst
Standard & Poor's, NYC

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Temp vaiables in formulas?

You can treat any empty cell as if it were a "variable". Just assign your
VLOOKUP formula to one of them and then reference that cell in your IF
function.

--
Rick (MVP - Excel)


"Andy Smith" wrote in message
...
Here's a common example: you want a formula with a VLOOKUP which either
looks
up the number you want, or returns zero if it's not in the table -- this
is
so that calculations based on that formula use zero and calculate
something
meaningful rather than result in #N/A!. So you have to do this:

IF(ISNA(VLOOKUP(...)),0,VLOOKUP(...))

Of course that "..." can be pretty long and hairy. And it's inefficient
too, because that long VLOOKUP has to be calculated twice. Isn't there
any
way of writing a formula so it calculates the VLOOKUP once, stored the
result, and uses just the result in the rest of the formula? That is:

R=VLOOKUP(...);IF(ISNA(R),0,R)

I realize you can insert columns just to hold temporary results, and then
hide them, but when you copy them and paste them outside Excel, you get
the
hidden columns too, and I don't want them.

Thanks!

--
Andy Smith
Senior Systems Analyst
Standard & Poor's, NYC


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Temp vaiables in formulas?

Check your other posts.

Andy Smith wrote:

Here's a common example: you want a formula with a VLOOKUP which either looks
up the number you want, or returns zero if it's not in the table -- this is
so that calculations based on that formula use zero and calculate something
meaningful rather than result in #N/A!. So you have to do this:

IF(ISNA(VLOOKUP(...)),0,VLOOKUP(...))

Of course that "..." can be pretty long and hairy. And it's inefficient
too, because that long VLOOKUP has to be calculated twice. Isn't there any
way of writing a formula so it calculates the VLOOKUP once, stored the
result, and uses just the result in the rest of the formula? That is:

R=VLOOKUP(...);IF(ISNA(R),0,R)

I realize you can insert columns just to hold temporary results, and then
hide them, but when you copy them and paste them outside Excel, you get the
hidden columns too, and I don't want them.

Thanks!

--
Andy Smith
Senior Systems Analyst
Standard & Poor's, NYC


--

Dave Peterson
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
Temp variables within formulas? Andy Smith[_2_] Excel Discussion (Misc queries) 2 May 7th 09 05:39 PM
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp Yuvraj Excel Discussion (Misc queries) 3 May 3rd 09 11:59 AM
Temp files in Excel Roselyn Nicewarner Excel Discussion (Misc queries) 1 August 10th 05 11:49 PM
I need a VLOOK-UP formula that uses two look-up vaiables in seper. Doug Excel Worksheet Functions 3 March 31st 05 06:23 PM
Location of Temp File(s) - If any RWN Excel Discussion (Misc queries) 11 January 5th 05 10:21 PM


All times are GMT +1. The time now is 04:41 PM.

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

About Us

"It's about Microsoft Excel"