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

Data Analysis

  • How to do a t-Test in Excel?
  • How to Create Area Chart in Excel
  • How to calculate average last N values in a table in Excel
  • Conditional Formatting New Rule with Formulas in Excel
  • What-If Analysis: Scenarios and Goal Seek in Excel

References

  • How to get relative column numbers in a range in Excel
  • How to use Excel TRANSPOSE Function
  • How to calculate two-way lookup VLOOKUP in Excel Table
  • How to get address of last cell in range in Excel
  • Excel Advanced Lookup using Index and Match Functions

Data Validations

  • Prevent invalid data entering in specific cells
  • Excel Data validation with conditional list
  • Excel Data validation whole percentage only
  • Excel Data validation allow weekday only
  • 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

  • IF, AND, OR and NOT Functions Examples in Excel
  • Return blank if in Excel
  • NOT function: Description, Usage, Syntax, Examples and Explanation
  • OR function Examples in Excel
  • IF function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • Calculate days remaining in Excel
  • How to calculate Next working/business day in Excel
  • Convert decimal minutes to Excel time
  • How to calculate project start date based on end date in Excel
  • Two ways to sum time over 30 minutes in Excel

Grouping

  • Map text to numbers in Excel
  • Map inputs to arbitrary values in Excel
  • Group numbers with VLOOKUP in Excel
  • Categorize text with keywords in Excel
  • Calculate conditional mode with criteria in Excel

General

  • Share Excel data with Word documents
  • Subtotal by invoice number in Excel
  • How to Create Calendar in Excel
  • Find, Select, Replace and Go To Special in Excel
  • How to create dynamic worksheet reference in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning