Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Lookup not working

I am using this macro but I have two problems when it runs
1 - If the text being searched for isnt there the it still returns a value
which is wrong
2- If the text being searched for is there but the result fiel is empty it
returns a zero i need it to leave the cell empty

Thank you

"=IF(RC[-2]="""","""",IF(R[-13]C[-2]=""WBM"",LOOKUP(R[11]C[-2],Densities!C[-5],Densities!C[-4]),LOOKUP(RC[-2],Densities!C[-1],Densities!C)))"
Range("H21").Select
Selection.AutoFill Destination:=Range("H21:H39"), Type:=xlFillDefault
Range("H21:H39").Select
Range("H21").Select
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Lookup not working

Mire,

It's not working because the first lookup ("WBM"=True) is a kleft lookup and
you can't do that you need index match.

Heres a corrected formula non R1C1 which you should be able to convert

=IF(C15="","",IF(C2="WBM",INDEX(A:A,MATCH(C26,IV:I V,FALSE),1),LOOKUP(C15,Densities!D:D,Densities!E:E )))

Mike

"Miree" wrote:

I am using this macro but I have two problems when it runs
1 - If the text being searched for isnt there the it still returns a value
which is wrong
2- If the text being searched for is there but the result fiel is empty it
returns a zero i need it to leave the cell empty

Thank you

"=IF(RC[-2]="""","""",IF(R[-13]C[-2]=""WBM"",LOOKUP(R[11]C[-2],Densities!C[-5],Densities!C[-4]),LOOKUP(RC[-2],Densities!C[-1],Densities!C)))"
Range("H21").Select
Selection.AutoFill Destination:=Range("H21:H39"), Type:=xlFillDefault
Range("H21:H39").Select
Range("H21").Select
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Lookup not working

"=IF(RC[-2]="""","""",IF(R[-13]C[-2]=""WBM""," & vbLf & _
"IF(ISERROR(LOOKUP(R[11]C[-2],Densities!C[-5],Densities!C[-4])),"""",LOOKUP(R[11]C[-2],Densities!C[-5],Densities!C[-4])),"
& vbLf & _
"IF(ISERROR(LOOKUP(RC[-2],Densities!C[-1],Densities!C)),"""",LOOKUP(RC[-2],Densities!C[-1],Densities!C))))"


--
__________________________________
HTH

Bob

"Miree" wrote in message
...
I am using this macro but I have two problems when it runs
1 - If the text being searched for isnt there the it still returns a value
which is wrong
2- If the text being searched for is there but the result fiel is empty it
returns a zero i need it to leave the cell empty

Thank you

"=IF(RC[-2]="""","""",IF(R[-13]C[-2]=""WBM"",LOOKUP(R[11]C[-2],Densities!C[-5],Densities!C[-4]),LOOKUP(RC[-2],Densities!C[-1],Densities!C)))"
Range("H21").Select
Selection.AutoFill Destination:=Range("H21:H39"), Type:=xlFillDefault
Range("H21:H39").Select
Range("H21").Select
End Sub



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
Lookup Working TOO Well Teddy-B Excel Discussion (Misc queries) 1 May 12th 09 04:34 PM
lookup between two worksheets not working well Angela Excel Worksheet Functions 5 April 7th 08 09:23 PM
LOOKUP Function Not working T Excel Discussion (Misc queries) 3 March 12th 08 04:34 PM
lookup not working nasim Excel Worksheet Functions 1 January 3rd 07 12:43 PM
LOOKUP is working - but VLOOKUP is not Jay Excel Discussion (Misc queries) 3 December 13th 06 02:42 PM


All times are GMT +1. The time now is 05:11 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"