Amend Offset to pick up row number

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,595
Office Version
  1. 2021
Platform
  1. Windows
I have a match function in Col F eg F5 to find the row number


I would like to amend the offset function to automatically include the row number

Code:
=OFFSET(Sales_Rep!E1357,0,COLUMNS(F1357:AQ1357))

I tried to amend as follows but cannot get it to work


Code:
=OFFSET(Sales_Rep!&F5,0,COLUMNS(F&F5:AQ&F5)


I have the following formula in F5 which returns the row number on sheet Sales_Rep


Code:
=MATCH(C5,Sales_Rep!B1:B1387,0)


It would be appreciated if someone could kindly amend my code
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Take a look at INDIRECT.

It lets you join ranges & text that functions can read. Note that it's very expensive, so you'll want to limit how many you have.
 
Upvote 0
Since COLUMNS(F1:AQ1)=COLUMNS(Fx:AQx) for any x, try

=OFFSET(INDEX(Sales_Rep!E:E,F5),0,COLUMNS(F1:AQ1))

or (avoiding OFFSET a volatile function)

=INDEX(Sales_Rep!F:AQ,F5,COLUMNS(F1:AQ1))

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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