MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Dec 12th, 2005, 06:18 PM   #1
a7n9
 
a7n9's Avatar
 
Join Date: Sep 2004
Location: WV, USA
Posts: 696
Default Find Column letter to use in a formula

Hello all,

I want to find the column letter to use in a formula. It would be clear when you look at this sheet.

******** ******************** ************************************************************************>
Microsoft Excel - Book3___Running: 11.0 : OS = Windows XP
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)bout
=

A
B
C
D
E
F
G
1
2
Fld1Fld2Fld3 RowNumber52
3
000
Sheet1

[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
a7n9 is offline   Reply With Quote
Old Dec 12th, 2005, 06:24 PM   #2
Norie
 
Norie's Avatar
 
Join Date: Apr 2004
Location: Yaren
Posts: 50,489
Default

Why not try OFFSET instead of INDIRECT?

=OFFSET(Sheet2!B3,$G$2-ROW(),0)
__________________
If posting code please use code tags.
Norie is offline   Reply With Quote
Old Dec 12th, 2005, 06:25 PM   #3
NBVC
 
NBVC's Avatar
 
Join Date: Aug 2005
Location: Ontario
Posts: 5,281
Default

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
NBVC is offline   Reply With Quote
Old Dec 12th, 2005, 06:25 PM   #4
just_jon
MrExcel MVP
 
just_jon's Avatar
 
Join Date: Sep 2002
Location: Alabama/State of Disarray
Posts: 10,473
Default

=INDEX(Sheet2!$1:$65536,$G$2,COLUMN())

You want to avoid a bunch of Indirects if you can.

EDIT to anchor the refs.
__________________
just_jon
Book of the Month: I'm Not Really an MVP, I Just Play One on TV [j. jon, 2004]
just_jon is offline   Reply With Quote
Old Dec 12th, 2005, 06:29 PM   #5
Oorang
 
Oorang's Avatar
 
Join Date: Mar 2005
Posts: 2,071
Default

Another way
=VLOOKUP(Sheet2!A3,Sheet2!3:3,Sheet1!G2,0))
__________________
  • Get better answers! Include your version of Office in your post.
Oorang is offline   Reply With Quote
Old Dec 12th, 2005, 06:59 PM   #6
a7n9
 
a7n9's Avatar
 
Join Date: Sep 2004
Location: WV, USA
Posts: 696
Default

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
a7n9 is offline   Reply With Quote
Old Dec 12th, 2005, 07:57 PM   #7
Norie
 
Norie's Avatar
 
Join Date: Apr 2004
Location: Yaren
Posts: 50,489
Default

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.
Norie is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


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


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2010 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes