Columns Function

ViKaMi

New Member
Joined
Feb 22, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I'm trying to use the Columns function. For array I'm using range name. If I put the range name directly on the formula it gives me the desired result. I want the formula to read the range name from a cell. Where I can type different range names instead of changing the range name (array) directly inside the formula.

range contains 7 rows and 22 columns.

range name = P2_

formula - =columns(P2_) returns 22 which is the desired result

formula =columns(C3) where C3 have P2_ typed in returns a result of 1
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I think you need to use the indirect function:
Excel Formula:
=Columns(Indirect(C3))
 
Upvote 0
Solution
Mr Excel 8.xlsm
ABCDE
1
2P2_324
3328
41468
59910
63749
7687
8178
9896
10391
11978
Sheet15
Cell Formulas
RangeFormula
A4A4=COLUMNS(A2)
A6A6=COLUMNS(INDIRECT(A2))
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top