formula works on one worksheet but not the other

kylefoley76

Well-known Member
Joined
Mar 1, 2010
Messages
1,553
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
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
does excel formulas work on themselves

i see your substitute is on A10 code is and thats where you say it dosent work
 
Upvote 0
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
 
Upvote 0
if A10 is your source then that should be static, but A15 will only report the A10
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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