Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jesahs
 
Posts: n/a
Default IF Function Nesting Problem


Here's my problem. I need to figure out how to nest a HLookUp function
within an IF function. If the hlookup finds the number in a seperate
worksheet, then I need it to display that in the cell, otherwise, if
the hlookup does not find the number, I just need a blank space.

I can't use the ISERROR function because of all the additional code
that would need inputting. I was hoping that I could figure out a way
to assign the HLookUp formula to a variable to reduce the calculation
time as well as the code size. Here's an example:

IF(a,a,"")

which would be this:

IF(HLOOKUP("Order",TrackingGantt!$A:$Z,MATCH($J20, TrackingGantt!$B:$B,FALSE),FALSE),HLOOKUP("Order", TrackingGantt!$A:$Z,MATCH($J20,TrackingGantt!$B:$B ,FALSE),FALSE),"")

or something similar.

Thanks


--
jesahs
------------------------------------------------------------------------
jesahs's Profile: http://www.excelforum.com/member.php...o&userid=30687
View this thread: http://www.excelforum.com/showthread...hreadid=503494

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default IF Function Nesting Problem

Why cant you simply use

IF(isna(HLOOKUP("Order",TrackingGantt!$A:$Z,MATCH( $J20,TrackingGantt!$B:$B,FALSE),FALSE)),"",HLOOKUP ("Order",TrackingGantt!$A:$Z,MATCH($J20,TrackingGa ntt!$B:$B,FALSE),FALSE))


"jesahs" wrote:


Here's my problem. I need to figure out how to nest a HLookUp function
within an IF function. If the hlookup finds the number in a seperate
worksheet, then I need it to display that in the cell, otherwise, if
the hlookup does not find the number, I just need a blank space.

I can't use the ISERROR function because of all the additional code
that would need inputting. I was hoping that I could figure out a way
to assign the HLookUp formula to a variable to reduce the calculation
time as well as the code size. Here's an example:

IF(a,a,"")

which would be this:

IF(HLOOKUP("Order",TrackingGantt!$A:$Z,MATCH($J20, TrackingGantt!$B:$B,FALSE),FALSE),HLOOKUP("Order", TrackingGantt!$A:$Z,MATCH($J20,TrackingGantt!$B:$B ,FALSE),FALSE),"")

or something similar.

Thanks


--
jesahs
------------------------------------------------------------------------
jesahs's Profile: http://www.excelforum.com/member.php...o&userid=30687
View this thread: http://www.excelforum.com/showthread...hreadid=503494


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jesahs
 
Posts: n/a
Default IF Function Nesting Problem


The reason I can't go that route, is because my boss says that it will
increase the loading time for the spreadsheet. He wants a minimal
amount of code for a minimal amount of computing.

I reading about Conditional Formatting. Seems like I could just use
this to make all errors defult to just a white cell. Is that a
possibility?


--
jesahs
------------------------------------------------------------------------
jesahs's Profile: http://www.excelforum.com/member.php...o&userid=30687
View this thread: http://www.excelforum.com/showthread...hreadid=503494

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jesahs
 
Posts: n/a
Default IF Function Nesting Problem


I left out an important detail. The main purpose is to remove any
*errors *that may appear on this sheet.

ISERROR and ISNA are not options. The fact that the already long
formulas are repeted twice causes an increase in calculation time
according to my boss.

What I'd like to do is assign a variable to my formula then use it in
an if statement. An example is shown in my original post above.

I'm looking at using a possible Conditional Format, but haven't gotten
it to work yet.

Thanks.


--
jesahs
------------------------------------------------------------------------
jesahs's Profile: http://www.excelforum.com/member.php...o&userid=30687
View this thread: http://www.excelforum.com/showthread...hreadid=503494

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default IF Function Nesting Problem

I suppose if your spreadsheet is huge, or if you have an old, slow PC, then
your boss' concern might be valid. However, if you have a reasonably recent
PC with 256 megs or RAM or more then the processing time is going to be
insignificant - 10 or 20 seconds to maybe a minute.

Any other solution is going to have the same issue - you have to trap for
errors and that means repeating the formula.

You cannot get around it by assigning the formula to a name (i.e.,
variable). If the formula generates an error in a cell - it will do so in
the name, too.




"jesahs" wrote:


I left out an important detail. The main purpose is to remove any
*errors *that may appear on this sheet.

ISERROR and ISNA are not options. The fact that the already long
formulas are repeted twice causes an increase in calculation time
according to my boss.

What I'd like to do is assign a variable to my formula then use it in
an if statement. An example is shown in my original post above.

I'm looking at using a possible Conditional Format, but haven't gotten
it to work yet.

Thanks.


--
jesahs
------------------------------------------------------------------------
jesahs's Profile: http://www.excelforum.com/member.php...o&userid=30687
View this thread: http://www.excelforum.com/showthread...hreadid=503494




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default IF Function Nesting Problem


Your conditional formatting will only "hide" the errors but if that is
what you want to do then in A1,

Condition 1

Formula is: =ISERROR(A1)

Use Format white.

Make sure you do not have the $ signs around the cell reference. With
cell A1 selected, click on the Format Painter then click on the corner
of the header row/column intersection to select the whole sheet. This
will apply the format to all cells in the sheet.

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=503494

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
Problem occur in sum function while deleting the rows Ellis Yu Excel Worksheet Functions 0 October 26th 05 02:50 AM
Problem with IF function haitch2 Excel Worksheet Functions 3 October 10th 05 01:05 AM
Solver problem where 'IF Function' is bad David Adamson Excel Discussion (Misc queries) 5 September 23rd 05 06:10 AM
IF function problem dvonj Excel Worksheet Functions 13 March 10th 05 01:13 PM
How do I nesting subtotal function within average function in Exc Amy Yeh Excel Worksheet Functions 4 January 19th 05 06:23 PM


All times are GMT +1. The time now is 02:53 AM.

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"