ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   refer to whole column (https://www.excelbanter.com/excel-discussion-misc-queries/255262-refer-whole-column.html)

Ken

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!


Dave Peterson

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

Jim Thomlinson

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
.



All times are GMT +1. The time now is 04:25 PM.

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