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

Data Analysis

  • Error Bars in Excel
  • Filter Data Based on Date in Excel
  • How To Create Pareto Chart in Excel
  • Excel Bar Chart
  • How to Create One and Two Variable Data Tables in Excel

References

  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel INDIRECT Function
  • Merge tables with VLOOKUP in Excel
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions
  • Basic INDEX MATCH approximate in Excel

Data Validations

  • Excel Data validation no punctuation
  • Excel Data validation allow uppercase only
  • Excel Data validation allow weekday only
  • Excel Data validation must not contain
  • Data validation must not exist 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

  • IF with boolean logic in Excel
  • How to use Excel TRUE Function
  • OR function Examples in Excel
  • Invoice status with nested if in Excel
  • IF function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • DAYS function: Description, Usage, Syntax, Examples and Explanation
  • Calculate number of hours between two times in Excel
  • Get days between dates ignoring years in Excel
  • Add business days to date in Excel
  • Add months to date in Excel

Grouping

  • Map inputs to arbitrary values in Excel
  • Group arbitrary text values in Excel
  • If cell contains one of many things in Excel
  • Map text to numbers in Excel
  • Group numbers with VLOOKUP in Excel

General

  • Common Errors in Excel
  • Freeze and Unfreeze Panes in Excel
  • How to Delete Cells, Row and Rows in Excel
  • Subtotal by color in Excel
  • Lock Cells in a Worksheet Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning