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/344862-re-insert-quotes-around-lookup-value.html)

bpeltzer[_2_]

Insert quotes around a lookup value
 
A cheap (dirty?) way to force Excel to convert a number to a string is to
enclose it inside the trim function; ex:
=HLOOKUP(TRIM(YEAR(D4)),A58:L64,N42+1)

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




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

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