A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

refer to whole column



 
 
Thread Tools Display Modes
  #1  
Old February 3rd, 2010, 09:14 PM posted to microsoft.public.excel.misc
Ken
external usenet poster
 
Posts: 954
Default refer to whole column

Hi!

How do I refer to a whole column by a number of a cell? For example, if a
number of a certain cell is 1, then the column will be A:A. If a number of a
cell is 3, the column will be C:C.

I will be using the result as the [Sum_Range] in a SUMIF function.

Thank you very much!

  #2  
Old February 3rd, 2010, 09:25 PM posted to microsoft.public.excel.misc
Dave Peterson
external usenet poster
 
Posts: 19,791
Default refer to whole column

=sumif(x:x,"xxx",indirect("C"&z999,false))

Where x:x contains the value you want to compare.
And z999 contains the column number


Ken wrote:

Hi!

How do I refer to a whole column by a number of a cell? For example, if a
number of a certain cell is 1, then the column will be A:A. If a number of a
cell is 3, the column will be C:C.

I will be using the result as the [Sum_Range] in a SUMIF function.

Thank you very much!


--

Dave Peterson
  #3  
Old February 3rd, 2010, 10:58 PM posted to microsoft.public.excel.misc
Jim Thomlinson
external usenet poster
 
Posts: 2,641
Default refer to whole column

You can do this without indirect. You can use index instead something like
this. The advantage is that index is not volatile saving the overhead of
recalculating.

=sumif(x:x,"xxx",INDEX(B:Z,,A1))

Where A1 contains the column number.

--
HTH...

Jim Thomlinson


"Dave Peterson" wrote:

=sumif(x:x,"xxx",indirect("C"&z999,false))

Where x:x contains the value you want to compare.
And z999 contains the column number


Ken wrote:

Hi!

How do I refer to a whole column by a number of a cell? For example, if a
number of a certain cell is 1, then the column will be A:A. If a number of a
cell is 3, the column will be C:C.

I will be using the result as the [Sum_Range] in a SUMIF function.

Thank you very much!


--

Dave Peterson
.

 




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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.