ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert quotes around a lookup value (https://www.excelbanter.com/excel-programming/344863-insert-quotes-around-lookup-value.html)

BabyFade27

Insert quotes around a lookup value
 
Greetings,

I have created a table inside a spreadsheet I've designed but am having a
hard time retreiving the information. I know what the problem is, howeverm
I'm stumped on how to resolve it.

My table looks a little like this:

2003 | 2004 | 2005 |
------------------------------
1 1643 | 1674 | 1713 |
------------------------------
2 2049 | 2093 | 2141 |

etc...

Okay, I'm using YEAR() functon to determine the year based on other
information used on the sheet.

=HLOOKUP(YEAR(D4),A58:L64,N42+1) is the formula I'm trying to get working.
If instead of using YEAR(D4) I use "2005" (with the quotes of course)
everything works fine.

What I'm trying to say is how do I get excel to put quotes around the result
of YEAR(D4)?

I'm sure there's a very simple solution to this problem... at least I hope
there is.



Dave Peterson

Insert quotes around a lookup value
 
A couple of other ways...

=hlookup(year(d4)&"", ...
=hlookup(text(year(d4),"0000"), ...
or
=hlookup(text(d4,"yyyy"),....



BabyFade27 wrote:

Greetings,

I have created a table inside a spreadsheet I've designed but am having a
hard time retreiving the information. I know what the problem is, howeverm
I'm stumped on how to resolve it.

My table looks a little like this:

2003 | 2004 | 2005 |
------------------------------
1 1643 | 1674 | 1713 |
------------------------------
2 2049 | 2093 | 2141 |

etc...

Okay, I'm using YEAR() functon to determine the year based on other
information used on the sheet.

=HLOOKUP(YEAR(D4),A58:L64,N42+1) is the formula I'm trying to get working.
If instead of using YEAR(D4) I use "2005" (with the quotes of course)
everything works fine.

What I'm trying to say is how do I get excel to put quotes around the result
of YEAR(D4)?

I'm sure there's a very simple solution to this problem... at least I hope
there is.


--

Dave Peterson


All times are GMT +1. The time now is 04:39 AM.

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