Excel calculation error when creating new sheet - excel

Description of my application in Excel:
I import data to a sheet called RAWDATA
Another already existing sheet Table1 is to be populated by data from cells containing references to RAWDATA.
The reference =RAWDATA!$A$1 is in one of the cells of Table1.
When I run the application, the previously mentioned cell returns #REF!.
I try to update calculations, manipulate with application calculation manual. I still get #REF!.
I click in the formula bar of the #REF! cell. Press enter. It calculates correctely.
What can I do to fix this?
Note that I can only use worksheet functions for the process of getting values to the table, not VBA code.

It is possible to postulate a theory that could explain this behavior. However, I would like to listen to an expert's opinion on this matter.
The issue in brief:
=RAWDATA!$A$1 returns a #REF! error.
#REF! error does not go away with recalculation, but it goes away by:
Using INDIRECT("=RAWDATA!$A$1") instead of =RAWDATA!$A$1.
Clicking on the formula bar of the #REF! cell and pressing enter.
I believe that excel does not recognize the data type that you import from the other application. Therefore, a reference to this data causes the #REF! error.
Can you check if this claim is true?
If it is false, it invalidates whatever is written below.
Excel has a built-in automatic conversion mechanism. For example, if a cell is formatted as text but it looks like a number (say " 10 ") then adding a numeric value to that, is legitimate, because excel internally converts that text to a number.
For some reason, the automatic conversion tool of excel does not work when you recalculate the sheet, but it works when you activate the reference cell and press enter (so when only the cell is recalculated). Also, it is triggered by INDIRECT.
So I tend to believe that the mechanism that infers the cell value type is induced by INDIRECT and by pressing enter in the formula bar, but not by recalculating the sheet.
PS: INDIRECT is a volatile function (it is reevaluated every time that excel recalculates) but since recalculation does not work in the first place, this is probably irrelevant.

Related

How to fix formulas calculating with CTRL+ALT+F9, but not with F9

I have an excel sheet into which data gets inserted from an outside software before it is opened. It returns either the empty string ("") or the number as string.
There is some really strange behaviour from Excel now though. The Data Points get copied into another cell without a problem although the 0s do not get inserted. Instead the cells just stay empty. The formula depending on that value just shows #NV.
The formulae seem to be correct as when one of the Origin cells is clicked and Enter is pressed, the depending values get calculated correctly.
Also "F9" doesn't do anything while CTRL+ALT+F9 calculates the whole sheet correctly. To me this seems really strange as if Excel just "doesn't know" the values have changed.
So we have 2 indications that don't match.
Since CTRL+ALT+F9 calculates all values it seems Excel just doesn't "know" it needs to calculate.
Since the values get copied it seems Excel does start doing something and stops for some reason.
I tried everything I can think of. Reformatting the cells, casting the input as an int before entering in into Excel and much more.
The formulae and result look like this. If CTRL+ALT+F9 these are all numbers instead of just the copied values that are drawn from another cell.
It looks like this:
It's German Excel
Formula left:
IF(LENGTH(G6)=0;0;G6)
Formula right:
IF(F18>0;VLOOKUP(CONCATENATE(G$2;" ";F18);Frequenzen!$A:$D;3;FALSCH);"")
Edit:
Autocalculate is turned on by the way. I also already tried putting VALUE() around everything since values are entered as strings. I don't really think formatting is a problem though as it calculates correctly when I force it to recalculate the whole sheet.
VBA is not an option as a solution since documents are saved on a server where it's not allowed.
From Support Office:
Calculate all worksheets in all open workbooks.
F9
Calculate the active worksheet.
Shift+F9
Calculate all worksheets in all open workbooks, regardless of whether
they have changed since the last calculation.
Ctrl+Alt+F9
Check dependent formulas, and then calculate all cells in all open
workbooks, including cells not marked as needing to be calculated.
Ctrl+Alt+Shift+F9
So based on the last part of what was added to Ctrl+Alt+F9 "...regardless of whether they have changed since the last calculation" to me implies that for the previous two case calculations will only occur if a change has been flagged.
I have a similar problem, in a simpler setting. My workbook just fails to recognize that a value has changed in a cell on another sheet which the cell in question is dependent on.
There are no error messages. Automatic recalc is on. There is no error in the formulas because retyping the exact same formula into the cell as was already there forces the necessary recalculation. Moreover, the problem occurs only when the workbook grows beyond a certain size (that certain size being about 6 mb on a machine with 32GB RAM). The workbook records incoming orders, with each new order being a new page, and sums across the order sheets to get order totals, and does calculations on other sheets that track inventory. All very simple. Just adding, subtracting and multiplying. If I hit ctrl-alt-f9, then all cells update to correct values.
My conclusion is Excel has a bug in its smart recalculation code.

Excel formula showed as '=#NULL' returns correct result

I have an Excel file, in that file I have plenty of formulas and ALL seem to do what they suppose to, give the results.
Now the weird part, I have found that some(few) cells instead of showing in formula bar original formula like =SUM(A1:A5) are now showing formula like =#NULL!.
However in cell it self result is displayed and it is correct result, recalculated with each change in sheet.
I had a backup copy of that file, I have copied formulas over and everything seemed fine until day after. When file was reopened issue has returned.
Have anyone have any idea how to sort out that mystery?
Edit:
Maybe I wasn't clear enough. Formulas are working and calculating correctly.
The issue lies in showing formula it self, formula bar isn't showing formula used for calculation, instead it is showing =#NULL! formula in formula bar.
Please see picture with 'Show Formula' enabled. All cells showing =#NULL! should actual formulas used for calculation.
Look specially at formula bar it self.
I can't give you a definitive answer without actually seeing all your formulas, but generally the #NULL! error appears when (according to documentation):
This error occurs when you specify an intersection of two areas that do not intersect. The intersection operator is a space character between references.
Most common issues (I'll use formula =SUM() since you used it in your original question, but this doesn't exclusively apply to it)
=SUM(A3 A6)
=SUM(A1:A5, B1:B5)
=SUM(A1, #REF!)
#REF! is commonly caused if you are referencing to a cell, that from
to a different worksheet that is no longer available, or the reference
is no longer correct altogether`
So to sum it up (no pun intended) check up if your formulas have correct seperators (,) or (;). Check if your formulas make sense (eg. you can't sum two ranges, use =SUBTOTAL()instead) and check if your cell references are still correct.

vba excel formula in locked cell changes to numeric value

I have a simple formula (an AutoSum) in a protected sheet and locked cell. My VBA code does not access this cell directly. Despite this, the formula sometimes changes to the numeric result when the sum changes. Any ideas how I can prevent this from happening?
It sounds like the Cell value is being set implicitly which over writes the formula. You may have a cell reference that you are missing. If your code does not set anything in that cell, then there is something in your workbook doing it. Try going to the Formulas tab and selecting Trace Dependents. See if an arrow points to something you were not aware of. Some of my sheets get so huge that I can loose track of things. Especially if I do any cutting and pasting.

Excel 2013 Forumla Not Working in some Cells

SO I'm trying to get some work done in Excel 2013, and after getting an initial formula to work, I dragged it across several other cells. I did all the standard locking of references and such, even copied the exact formula into the new cell formula window with copy paste. The formula works in the first cell, not in those it's dragged over. It also works in seemingly random cells when pasted around (see screen shot).
Formula is below... this was a brand new sheet, the cells had not been initialized until the formula was pasted. Is this an issue with Excel 2013? Since the formula works in some pastes perfectly, and not in others, I don't think that's the issue... I changed the cell format after the pastes in a couple cells to see if that changed results at all - it does not.
Update: I added in the false value, and the IF is evaluating to false on the zero cells... why it's correctly true in some, and false in others is still a mystery.
=MIN(IF('Metrics'!$DL$2:$DL$1725=$L$2&$O$2,'Metrics'!$DH$2:$DH$1725))
The issue is that for the formula to correctly evaluate it should be set as an array (ctrl-shift-enter).
However, Excel 2013 seems to randomly recognize the formula as an array formula, and sometimes not. Thus the formula occasionally will work, in a brand new, uninitialized cell, using/displaying the standard formula, and a correct result. Other times it will still display the same formula, but produce incorrect results since it is not being evaluated as an array.
Any of the cells that did not magically convert to an array formula, when changed to array, will update with correct values.
Only manually changed cells reflect the {=MIN(IF(...)...))} indication of an array formula. Cells in which the formula produced correct results still display as a non-array formula.
I had a similar if not exactly the same issue. Try hitting F9 to recalc the sheet, or go to File>Options, go to "Formulas" and under "Workbook Calculations" set it to "Automatic".
Solved my problem, which manifested the same way yours did.
Good luck!
Since you are,using $ sign to lock the cells in the formula, it looks like you are just pointing it to the same cells giving you same results... Click on the formula and check or change to the correct reference cells as you desire...
turns out my 2003 excel problem was due to some circular formulas. Had "Circular:" at the very bottom line. When these all fixed, the other cells started to calculate properly.

Can you tell Excel not to recalculate a cell whose contents are based on a COM component?

I've got an Excel spreadsheet that uses a C# Component.
The component is an Excel Add-in and it's called via a cell's formula function.
ie
=MyCalculation(C24)
The cell C24 has a hard coded value in it, ie text that never changes and isn't based off of a formula.
However, if I instrument my C# code for the MyCalculation I find that it's called 3 different times for each cell that has that formula during the setup.
I've cached the calculation on the C# side but I'd like to know if there anyway to tell Excel that this value never changes and it only needs to look it up once?
I assumed that if its dependencies never change then it wouldn't recalculate the value.
Excel's calculation algorithm is such that it frequently calculates formulae/functions more than once. Usually (but version dependent) after the initial calculation has determined a final calculation sequence the formulae/functions only get recalculated when they are dependent on a cell that has been dirtied (note that setting a cell to "Fred" dirties the cell even if it already contains "Fred") or is volatile.
However there are also more unusual circumstances that cause cells to be recalculated.
There is more information about this at my website.
There is no way of telling Excel never to recalculate a formula, (apart from converting the formula to a constant) except by inhibiting calculation for an entire sheet.

Resources