Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Error Bars in Excel
  • How to calculate correlation coefficient Correlation in Excel
  • Number and Text Filters Examples in Excel
  • Get column index in Excel Table
  • How to create Checklist in Excel

References

  • How to use Excel MMULT Function
  • How to calculate two-way lookup VLOOKUP in Excel Table
  • Create hyperlink with VLOOKUP in Excel
  • To count total rows in a range in Excel
  • Convert text string to valid reference in Excel using Indirect function

Data Validations

  • Excel Data validation unique values only
  • Excel Data validation only dates between
  • Data validation must not exist in list
  • Excel Data validation date in specific year
  • Excel Data validation exists in list

How to get relative column numbers in a range in Excel

by

This tutorial shows how to get a full set of relative column numbers in a range using an array formula based on the COLUMN function.

Formula

{=COLUMN(range)-COLUMN(range.firstcell)+1}


On the worksheet, this must be entered as multi-cell array formula using Control + Shift + Enter

This is a robust formula that will continue to generate relative numbers even when columns are inserted in front of the range.

Explanation

In the example shown, the array formula in B4:H4 is:

{=COLUMN(B4:H4)-COLUMN(B4)+1}

How this formula works

The first COLUMN function generates an array of 7 numbers like this:

{2,3,4,5,6,7,8}

The second COLUMN function generates an array with just one item like this:

{2}

which is then subtracted from the first array to yield:

{0,1,2,3,4,5,6}

Finally, 1 is added to get:

{1,2,3,4,5,6,7}

With a named range

You can adapt this formula to use with a named range. For example, in the above example, if you created a named range “data” for B4:H4, you can use this formula to generate column numbers:

{=COLUMN(data)-COLUMN(INDEX(data,1,1))+1}

Post navigation

Previous Post:

How to calculate project complete percentage in Excel

Next Post:

Popularly Used Excel Functions and their examples

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • Invoice status with nested if in Excel
  • How to return blank in place of #DIV/0! error in Excel
  • How to use Excel AND Function
  • FALSE function: Description, Usage, Syntax, Examples and Explanation
  • Complete List of Excel Logical Functions, References and Examples

Date Time

  • WORKDAY function: Description, Usage, Syntax, Examples and Explanation
  • Calculate expiration date in Excel
  • How to calculate future date say 6 months ahead in Excel
  • WEEKDAY function: Description, Usage, Syntax, Examples and Explanation
  • EDATE function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • Running count group by n size in Excel
  • Group arbitrary text values in Excel
  • Calculate conditional mode with criteria in Excel
  • Categorize text with keywords in Excel
  • Group times into 3 hour buckets in Excel

General

  • Transpose: Switch ‘Rows to Columns’ or ‘Columns to Rows’ in Excel
  • How to calculate total from percentage in Excel
  • Count cells that contain errors in Excel
  • Subtotal by color in Excel
  • 3D SUMIF for multiple worksheets in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning