Fix Column Reference? Changes with External Data Refresh

Scotster

Board Regular
Joined
May 29, 2017
Messages
59
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
I have a sheet that pulls data in from a SAP tool. It's updated each week, column count is always the same but the column heading changes by rolling on a week. When this happens the formula above the table moves reference even though I'm not using the header name.

4 (formula to calculate AP from below)444
Part Number15.202416.202417.202418.2024
Part110203010
Part200510
Part351505

The formula that I'm using is as below:

Code:
=APno(VALUE(LEFT($F$8,SEARCH(".",$F$8)-1)),VALUE(RIGHT($F$8,LEN($F$8)-SEARCH(".",$F$8))))

APNo is a function that I've created that takes the referenced week number (15) and the year (2024) and calculates which AP it is based on my companies calendar layout. Just for rerefence.

The issue I've got is that if I refresh the data, the file that I'm referenced has rolled on the week/year references. I wouldn't think this would impact the formula, but for whatever reason it does. The column count that I'm pulling is the same, there are no changes other than to the heading name.

I expected

4445
Part Number16.202417.202418.202419.2024
Part12030105
Part2051010
Part315055

But instead I get the first AP reference as "N/A" as it's attempting to formulate as below:

Code:
=APno(VALUE(LEFT($E$8,SEARCH(".",$E$8)-1)),VALUE(RIGHT($E$8,LEN($E$8)-SEARCH(".",$E$8))))

Why is the column reference being changed to "E"? Is there any way to have it remain "F" without going into column() references in the formula (the only workaround I've thought of so far)?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Just as an addon, this is what I've found to work as a solution but it just doesn't sit right that I need to do this. Is this the only way?

Code:
=APno(VALUE(LEFT(INDIRECT(ADDRESS(8,COLUMN())),SEARCH(".",INDIRECT(ADDRESS(8,COLUMN())))-1)),VALUE(RIGHT(INDIRECT(ADDRESS(8,COLUMN())),LEN(INDIRECT(ADDRESS(8,COLUMN())))-SEARCH(".",INDIRECT(ADDRESS(8,COLUMN()))))))
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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