#1   Report Post  
Steven
 
Posts: n/a
Default =Cell( , )

I cannot get this function to work when using a VLookup.

My formula is =Cell("contents",VLOOKUP(D5,D8:E10,2,0))

where the VLookup returns an A1 or B1 or C1 etc. If I manually input the
formula =Cell("contents",A1) then it works fine. But when using the vlookup
in the formula I get an error.

What is wrong?

Thanks for your help.

Steven
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Steven,

The VLOOKUP returns a string, not a cell reference. INDIRECT that value to
get what you want

=CELL("contents",INDIRECT(VLOOKUP(D5,D8:E10,2,0)))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steven" wrote in message
...
I cannot get this function to work when using a VLookup.

My formula is =Cell("contents",VLOOKUP(D5,D8:E10,2,0))

where the VLookup returns an A1 or B1 or C1 etc. If I manually input the
formula =Cell("contents",A1) then it works fine. But when using the

vlookup
in the formula I get an error.

What is wrong?

Thanks for your help.

Steven



  #3   Report Post  
KL
 
Posts: n/a
Default

Sorry, for sure I am missing something, but what is the point of using the
CELL function here?
=INDIRECT(VLOOKUP(D5,D8:E10,2,0))
=CELL("contents",INDIRECT(VLOOKUP(D5,D8:E10,2,0)))

Shouldn't these return the same?

Thanks and regards,
KL

"Bob Phillips" wrote in message
...
Steven,

The VLOOKUP returns a string, not a cell reference. INDIRECT that value to
get what you want

=CELL("contents",INDIRECT(VLOOKUP(D5,D8:E10,2,0)))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steven" wrote in message
...
I cannot get this function to work when using a VLookup.

My formula is =Cell("contents",VLOOKUP(D5,D8:E10,2,0))

where the VLookup returns an A1 or B1 or C1 etc. If I manually input the
formula =Cell("contents",A1) then it works fine. But when using the

vlookup
in the formula I get an error.

What is wrong?

Thanks for your help.

Steven





  #4   Report Post  
Steven
 
Posts: n/a
Default

I am not sure if you are asking me why use cell here but what I am doing is
using an Add On product to excel that reads in a csv file with many fields.
But the program does not want all the fields. Based on the Category I want
to update in the program I have to pick certain fields as the csv file is
read in. Therefore by using this Cell function I can basically use a drop
down to Pick the Category I want to update and based on the cell references
next to that category in the VLookup section it will tell the program which
columns (ie fields) to read in.

Thank you for both or yours help.

Steven.
  #5   Report Post  
Harlan Grove
 
Posts: n/a
Default

"KL" wrote...
Sorry, for sure I am missing something, but what is the point of using the
CELL function here?
=INDIRECT(VLOOKUP(D5,D8:E10,2,0))
=CELL("contents",INDIRECT(VLOOKUP(D5,D8:E10,2,0)) )

Shouldn't these return the same?

....

They do return the same thing, so there's no point to the CELL call.




  #6   Report Post  
Tushar Mehta
 
Posts: n/a
Default

Irrespective of what you are doing, the point is that the two formulas
below return *identical* results:

=INDIRECT(VLOOKUP(D5,D8:E10,2,0))
=CELL("contents",INDIRECT(VLOOKUP(D5,D8:E10,2,0)))

So, why use the CELL (...INDIRECT(VLOOKUP(...))) when just INDIRECT
(VLOOKUP(...)) will suffice?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I am not sure if you are asking me why use cell here but what I am doing is
using an Add On product to excel that reads in a csv file with many fields.
But the program does not want all the fields. Based on the Category I want
to update in the program I have to pick certain fields as the csv file is
read in. Therefore by using this Cell function I can basically use a drop
down to Pick the Category I want to update and based on the cell references
next to that category in the VLookup section it will tell the program which
columns (ie fields) to read in.

Thank you for both or yours help.

Steven.

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



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