#Ref error with refreshable dataset

MahmoudSa

New Member
Joined
Sep 6, 2014
Messages
13
I have a dataset retrieving data from SQL view, upon which I have built several functions. The problem is, when I refresh the data set, all the funtions get corrupted with the common "#Ref" error.


Your help is highly appreciated,
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

MahmoudSa

New Member
Joined
Sep 6, 2014
Messages
13
Hellow Mr. Andrew
I do appreciate your prompt response. The excel I am working on retrieves data from SQL server, it is supposed to be a plug and play. So I should simply throw this excel file on a specific machine and change the data sources accordingly (after creating the required SQL view). While changing the data source, it will prompt an authentication box and then refresh the data automatically. Once refreshed, the formulas and functions get corrupted.
I will try to clarify my case throw the following screen shots:

1- Original Data Set
2- First Column Formulas : Index Column
3- Second Column Formulas: Data set, with no blanks
4- Third Column Formulas: Reference

2,3 and 4 numbers above, are the formulas columns built on the "Original Data Set", which is being refreshed as it retrieves data from SQL view.

Now, when I copy this file and throw on another machine to retrieve data from another SQL server, I change the connection strings manually and then the data is refreshed. The end result, everything is corrupted with the #Ref error.

By the way, I have revised a previous post for you Mr. Andrew talking about the same issue on #REF errors with updating database connections/Cell references changing. Although, my tries are still in vain.

Appreciate any in-depth clarification and guidelines on how to get this solved out.
 

MahmoudSa

New Member
Joined
Sep 6, 2014
Messages
13

ADVERTISEMENT

Definitely, I have just connected the Excel to another data source, and refreshed the data.

First Column Formula is fine (since the function in this one is built upon the same column)
Second Column Formula got corrupted, and ranges have shifted in a weird way - Link
Third Column Formula got corrupted, and ranges have shifted in a weird way as well - Link D

Looking forward to hearing from you,
Best Regards,
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Please copy the formula that gets corrupted and paste it into a reply stating which cell it's in. It's difficult working with images.
 

MahmoudSa

New Member
Joined
Sep 6, 2014
Messages
13

ADVERTISEMENT

The first line is before the data set is refreshed, and the second line shows how the error occurs (#Ref error and Ranges shift)
=IFERROR(INDEX($A$2:$A$30,SMALL(IF($A$2:$A$30<>"",ROW($A$2:$A$30)-ROW($A$2)+1),ROWS(J$2:J2))),"")
=IFERROR(INDEX($C$8:$C$30,SMALL(IF($C$8:$C$30<>"",ROW($C$8:$C$30)-ROW(#REF!)+1),ROWS(E$2:E2))),"")

Best Regards,
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Try this formula:

=IFERROR(INDEX(INDEX(A:A,ROW(J$2)):INDEX(A:A,ROW(J$30)),SMALL(IF(INDEX(A:A,ROW(J$2)):INDEX(A:A,ROW(J$30))<>"",ROW($J$2:$J$30)-ROW($J$2)+1),ROWS(J$2:J2))),"")
 

MahmoudSa

New Member
Joined
Sep 6, 2014
Messages
13
It didn't work either, here is how it becomes after I refreshed the data set

=IFERROR(INDEX(INDEX(C:C,ROW(E$2)):INDEX(C:C,ROW(L$30)),SMALL(IF(INDEX(C:C,ROW(E$2)):INDEX(C:C,ROW(L$30))<>"",ROW($L$2:$L$30)-ROW($E$2)+1),ROWS(E$2:E2))),"")
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,156
Messages
5,835,702
Members
430,380
Latest member
Psalmysam

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