ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   =Cell( , ) (https://www.excelbanter.com/excel-worksheet-functions/9653-%3Dcell.html)

Steven

=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

Bob Phillips

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




KL

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






Steven

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.

Harlan Grove

"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.



Tushar Mehta

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.



All times are GMT +1. The time now is 08:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com