![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Join Date: Sep 2004
Location: WV, USA
Posts: 696
|
Hello all,
I want to find the column letter to use in a formula. It would be clear when you look at this sheet. ******** ******************** ************************************************************************>
[HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR. As you can see in B3:D3 I have a formula, which uses a row number from cell G2, but as a column letter I've manually entered it as B, C and D. Is there a way to elminiate this manual portion and write a formula, which would find the column letter too? I've many fields like these, therefore I want a formula, which I can drag. Thanks for your help.
__________________
If you've exhausted all the possibilities, remember this; you haven't! <a href = "http://www.nandeshwar.info">My home page</a> My Excel/VBA Blog |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
#3 |
|
Join Date: Aug 2005
Location: Ontario
Posts: 5,281
|
One way:
=INDIRECT("Sheet2!"&LEFT(ADDRESS(1,COLUMN(),4),1)&$G$2)
__________________
Where there is a will there are many ways. Finding one that works for you is the challenge! Colo's HTML Maker: Instructions |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Sep 2002
Location: Alabama/State of Disarray
Posts: 10,473
|
=INDEX(Sheet2!$1:$65536,$G$2,COLUMN())
You want to avoid a bunch of Indirects if you can. |
|
|
|
|
|
#5 |
|
Join Date: Mar 2005
Posts: 2,071
|
Another way
=VLOOKUP(Sheet2!A3,Sheet2!3:3,Sheet1!G2,0))
__________________
|
|
|
|
|
|
#6 |
|
Join Date: Sep 2004
Location: WV, USA
Posts: 696
|
Thanks everyone.
just_jon: Very simple solution, thanks. (why didn't I think of that) NBVC: It works, thanks. Now, I know how to find a column letter. Norie: You're the boss, however, I didn't understand why are you substracting the current row?
__________________
If you've exhausted all the possibilities, remember this; you haven't! <a href = "http://www.nandeshwar.info">My home page</a> My Excel/VBA Blog |
|
|
|
|
|
#7 |
|
Join Date: Apr 2004
Location: Yaren
Posts: 50,489
|
Because we're using OFFSET.
The formula is in row 3 so if we offset by 52 rows we end up in row 55 on the other sheet, therefore if we subtract the row number of the cell we get the required 52.
__________________
If posting code please use code tags. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|