formula works on one worksheet but not the other

kylefoley76

Well-known Member
Joined
Mar 1, 2010
Messages
1,550
The formula I'm using is

Code:
=SUBSTITUTE(OFFSET(A10,-2,0),VLOOKUP(OFFSET(A10,-1,0),prim!$D$1:$I$263,5),VLOOKUP(OFFSET(A10,-1,0),prim!$D$1:$I$263,6))

But it doesn't work at all on one worksheet, half works on another, and works sometimes on another.

In the worksheet attached called workbook 4, it works a15 sheet 2, but not a10 sheet 2. But that was not always the case. In the worksheet attached justification copy, it works in a14 sheet 4 but not in a10 but for a good while it didn't work in both. In my own private doc it doesn't work in both cases.


https://drive.google.com/file/d/0B9zzW6-3m2qGTTM1aElsX0FuZmc/edit?usp=sharing
https://drive.google.com/file/d/0B9zzW6-3m2qGZUk0aHl6aUZPLVk/edit?usp=sharing

I should also add that I was able to get the formula to work when I stuck with one page
 

Some videos you may like

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
does excel formulas work on themselves

i see your substitute is on A10 code is and thats where you say it dosent work
 

markmzz

MrExcel MVP
Joined
May 7, 2011
Messages
3,699
Try this small modification in your formula:

Code:
=SUBSTITUTE(OFFSET(A10,-2,0),VLOOKUP(OFFSET(A10,-1,0),prim!$D$1:$I$263,5[COLOR="#FF0000"],0[/COLOR]),VLOOKUP(OFFSET(A10,-1,0),prim!$D$1:$I$263,6[COLOR="#FF0000"],0[/COLOR]))

Markmzz
 

mole999

Moderator
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows

ADVERTISEMENT

if A10 is your source then that should be static, but A15 will only report the A10
 

kylefoley76

Well-known Member
Joined
Mar 1, 2010
Messages
1,550
pretty bizarre. it worked in the first cell. it didn't work in the second cell. so i changed that 0 to a 1, then i changed the 1 back to a zero and it worked. i wish it would be more consistent.
 

markmzz

MrExcel MVP
Joined
May 7, 2011
Messages
3,699
pretty bizarre. it worked in the first cell. it didn't work in the second cell. so i changed that 0 to a 1, then i changed the 1 back to a zero and it worked. i wish it would be more consistent.

In this case you want to find an exact match, so you need zero (or false) in the last argument of the function VLookup.

More information about the VLookup function:

VLOOKUP function - Excel - Office.com

Markmzz
 

Watch MrExcel Video

Forum statistics

Threads
1,123,307
Messages
5,600,869
Members
414,411
Latest member
Snowmanaus

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
Top