ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom Function Referancing Cell Value (https://www.excelbanter.com/excel-programming/356561-custom-function-referancing-cell-value.html)

Abode

Custom Function Referancing Cell Value
 
Hello. I'm having a little trouble making a custom function that will show
the value of another cell. Basically what I want is a Function that will get
a Cell location from a neighboring cell and then use that value to output the
answer of that cell. I'm not sure if it makes any sence but I'll post an
example of what I'm hoping I can do.

Column F
Name 1
Name 2
Name 3

Column G
=TestDisplay(H1)

Column H1
(Now in this column I can type in F1 and the function in G will display
"Name 1")

I'm not sure if any of that helps afterall. But is there a way to do this.
When I've tried I get either #NAME or #VALUE errors.




kassie

Custom Function Referancing Cell Value
 
In G1 enter =IF(H1="","",INDIRECT(H1))

"Abode" wrote:

Hello. I'm having a little trouble making a custom function that will show
the value of another cell. Basically what I want is a Function that will get
a Cell location from a neighboring cell and then use that value to output the
answer of that cell. I'm not sure if it makes any sence but I'll post an
example of what I'm hoping I can do.

Column F
Name 1
Name 2
Name 3

Column G
=TestDisplay(H1)

Column H1
(Now in this column I can type in F1 and the function in G will display
"Name 1")

I'm not sure if any of that helps afterall. But is there a way to do this.
When I've tried I get either #NAME or #VALUE errors.




Abode

Custom Function Referancing Cell Value
 
Thanks, That helps a lot. I kind of want to expand on it and Make it so I
dont have to type the H everytime. Is there a way that I can somehow add a H
on there and have Indirect read it.. I tried with the Numbers Tab in "Format
Cells". It always returns a #REF error and I thikn I found that even though
it reads a Cell that says H1 on there it only reads the 1.

"kassie" wrote:

In G1 enter =IF(H1="","",INDIRECT(H1))

"Abode" wrote:

Hello. I'm having a little trouble making a custom function that will show
the value of another cell. Basically what I want is a Function that will get
a Cell location from a neighboring cell and then use that value to output the
answer of that cell. I'm not sure if it makes any sence but I'll post an
example of what I'm hoping I can do.

Column F
Name 1
Name 2
Name 3

Column G
=TestDisplay(H1)

Column H1
(Now in this column I can type in F1 and the function in G will display
"Name 1")

I'm not sure if any of that helps afterall. But is there a way to do this.
When I've tried I get either #NAME or #VALUE errors.




kassie

Custom Function Referancing Cell Value
 
Hi

You cannot use a number format, as a cell reference is in fact text. A
workaround would be to put the H in a seperate column, say Col I, and using
the following formula instead:

=IF(H1="","",INDIRECT(CONCATENATE(I1,H1)))

You can hide this column, or simply paint the font white to hide it, if that
is needed.

"Abode" wrote:

Thanks, That helps a lot. I kind of want to expand on it and Make it so I
dont have to type the H everytime. Is there a way that I can somehow add a H
on there and have Indirect read it.. I tried with the Numbers Tab in "Format
Cells". It always returns a #REF error and I thikn I found that even though
it reads a Cell that says H1 on there it only reads the 1.

"kassie" wrote:

In G1 enter =IF(H1="","",INDIRECT(H1))

"Abode" wrote:

Hello. I'm having a little trouble making a custom function that will show
the value of another cell. Basically what I want is a Function that will get
a Cell location from a neighboring cell and then use that value to output the
answer of that cell. I'm not sure if it makes any sence but I'll post an
example of what I'm hoping I can do.

Column F
Name 1
Name 2
Name 3

Column G
=TestDisplay(H1)

Column H1
(Now in this column I can type in F1 and the function in G will display
"Name 1")

I'm not sure if any of that helps afterall. But is there a way to do this.
When I've tried I get either #NAME or #VALUE errors.





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

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