Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Determining Columns in a Range.
by Allen Wyatt
(last updated June 27, 2020)
One of the handy worksheet functions provided by Excel allows you to determine the number of columns in a range. This is accomplished through the use of the COLUMNS function. For instance, consider the following formula:
The value returned is 3, since the range includes columns B, C, and D. You are not limited to address ranges (such as B2:D15); you can also use named ranges with the COLUMNS function.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10206) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Determining Columns in a Range.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Most calculations are done using the decimal numbering system. If you need to convert your decimal values to a differing ...Discover More
You can use the CLEAN worksheet function to remove any non-printable characters from a cell. This can come in handy when ...Discover More
Need to find the lowest numbers in a range of values? It's easy to do using the SMALL worksheet function, or you can use ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.