I have made a connection in excel to another excel workbook, using the native functionality found under the data tab in excel. I imported the data into my "Main" excel workbook from the "Other" workbook by Selecting Data->existing connections and then opening the relevant sheet. This allowed me to link the data from my other workbook to my Main workbook.
My issue is when the data in the Other workbook is changed i received a #ref error in my Main workbook. The formulas i use on the imported data are pasted in a separate sheet (i tried pasting it next to the imported data as well). Note: i paste the formulas from row 1 - 500 for the respective column, so that when the data is imported the formula automatically populates the cell with the correct value. When i refresh the data (i.e when data has been changed in the Other workbook) It seems as the formulas i have copied down do not reference the correct cell anymore.
I have tried using an indirect but to no success.
This is what the formula i use looks like
=IF(INDIRECT("A"&ROW(#REF!))<>"",VLOOKUP(INDIRECT("A"&ROW(#REF!)),'Safex Codes'!$A$1:$H$1000,8,0),"")
However when the data is refreshed "SOME" of the rows in the column the formula is in return this formula
=IF(INDIRECT("A"&ROW(#REF!))<>"",VLOOKUP(INDIRECT("A"&ROW(#REF!)),'Safex Codes'!$A$1:$H$1000,8,0),"")
This occurs everytime i refresh the data. What is strange is that at the end of my data, hence the last time the formula is being called, the referencing to the correct row is completely off.
For example in row 28 i would expect the above formula to reference a28, however i receive
=IF(INDIRECT("A"&ROW(A24))<>"",VLOOKUP(INDIRECT("A"&ROW(A24))
I'll bet that you're having the same issue I was. When the number of rows in the data range changes, the unused cells previously populated with data are deleted. The formulas that referenced those deleted cells no longer have references to them because they've been deleted (hence the #REF errors).
You can change Excel's behavior with respect to handling new or unused rows using the Properties menu on the Data tab.
In that menu, take a look at the section labeled "If the number of rows in the data range changes upon refresh." I'm guessing you have the first option checked. Try the third option.
Related
Is there a way to fix #REF! error on COUNTIFS formulas when the reference spreadsheet gets replaced? For instance, I receive a new master spreadsheet in a different file every month. Using COUNTIFS, I created a table to count with specific criteria based on a master spreadsheet. When I receive a new file, I make a copy of the master spreadsheet and move it to the original file with the table. The old spreadsheet is deleted. The new spreadsheet is under the same name. However, the reference in COUNTIFS breaks and #REF! error occurs.
If there isn't a change to the masterfile, can you just do a data dump and copy/paste the new data over the old? This will prevent the original sheet from being deleted and causing the reference error. Another option would be to copy/paste the formulas over to the new mastersheet so the formulas are preserved.
The question closest to mine did not return a satisfactory answer.
Inserted formula with cell reference does not recognize new input
In a particular macro-enabled workbook, macro-generated formulas do not change output values when data in referenced cells is changed. For instance, I can enter some numbers in referenced cells and the formula-containing cell will show the calculated number, but those numbers will not change when changing the data in the references. Manually typed formulas in the same workbook show the same behavior regardless of being in or outside range objects or in non-macro generated worksheets within this workbook. It doesn't seem to be specific to any particular formula.
I checked that the cells are formatted as numbers and that the formulas are valid. Formulas still appear in the cells after computing values.
Reloading the same workbook without macro-enabling shows the formulas working correctly.
In another macro-enabled workbook no problem is observed.
I checked property settings in the VBA editor and found no differences between them.
It seems like something is going on related to macro-enabling and not any particular code that is causing formulas to become unresponsive, but I am stumped as to what that could be.
Here is the formula in which I noticed the problem:
in "=d4:d21" the array formula "{=IF(ISNUMBER(C4:C21), C4:C21/C3, "0")}"
Even with a simple formula placed anywhere on the sheet like "=average(f4:f6)", this problem occurs.
I think creating the macro containing these lines of code is when the issue started, but they are not specific to it:
Sub CreateDataSheet()
Sheets.Add After:=ActiveSheet
Range("d4:d21").Select
Selection.FormulaArray = _
"=IF(ISNUMBER(RC[-1]:R[17]C[-1], RC[-1]:R[17]C[-1]/R[-1]C[-1], ""0"")"
End Sub
How can I get these formulas to work again?
The calculations in the workbook were set to 'manual' and I changed it to 'automatic'. The formulas work now.
Ive got three worksheets setup.
The first contains reference data for my data validation list.
The second references the first sheet for a data validation drop down list. Something like sheet1!$a1:$a3
The problem arises when I try and copy the cell in sheet two that contains the data validation drop down list to a cell in sheet 3 where the destination cell is empty.
I'm trying to copy excel data validation but when copied across to sheet 3 it references the cells $a1:$a3 but doesn't maintain the reference to sheet1 where the data for the drop down list is actually stored.
How can I copy the data validation such that when it is copied to sheet 3 it still maintains the reference to sheet1 where the static data that makes up the list is.
If I am understanding you correctly, the pasted Data Validation list is not showing the corrrect information. In my workbook I needed multiple cells of DV to display info from the sheet labled "Parts" after they were copied to the sheet labled "Ascending".
What I had to do was select my newly, and thus far incorrectly, pasted material, go to the 'Data' tab and click into 'Data Validaion --> Data Validation' (drop down menu). From here I had to edit the source to reflect the origional sheet.
Was: =$C$4:$C$21
Edit: =Parts!$C$4:$C$21
This determines what sheet the data is being validated from. Once Ive done this, I can copy and paste a DV interal to whatever sheet I am working on.
For some reason naming the range from the origional sheet (Parts) did not carry over in the pasted DV. VLOOKUP and other formulas thankfully work fine.
I have an Excel Addin that generate data from database.
after loading data on sheet (sheet1) , I write excel functions(in sheet2)depending on that data , at the beginning it works great, but when I re-exrcute my function(sheet1)and then refresh the sheet2 I get the #REF error !!
=+MAX(SUM(Table1[[#ALL];[column1]]);SUM(Table1[[#ALL];[Column2]))
Invalid cell reference errors occur when a spreadsheet formula contains incorrect cell references. This happens most often when:
Columns or rows containing data used in the formula are accidentally deleted.
A formula has been moved or copied to another cell and the cell references are incorrect.
Data used in a formula has been moved, leaving the function or formula with incorrect cell references
You need to go through it and find the error I'm afraid manually.
Is generating data operation generate same line count every time? If second generating operation generates less then first generation, your function couldn't find lines at the end and generate #REF error.
Is the table name changing when you run the add-in to generate data from the database? Your formula references Table1, but it is possible that the table name changes when you re-generate it using the add-in.
I am using XSSF to create a workbook and continually getting this error:
Excel found unreadable content in 'thefile'.xlsx. Do you want to recover the contents of this workbook? If you trust the source of the workbook click Yes.
Excel then obligingly recovers it by removing all of the data and gives the detail error report:
Removed Records: Cell information from /xl/worksheets/sheet1.xml part
I am following these principles:
Ensure the row is created and not null.
Ensure the cell is created and not null.
Ensure the cell is the correct type.
Write to cell.
Is there something I am missing, eg is it permissable to have only certain cells written to in a row eg:
|null|null|write something here|null|null|
and the same with rows:
row with content
null
row with content
or do I need to ensure the all rows and columns are filled blank through the ranges used.
This is a complete mystery.