#NAME? error on correct Excel formula - syntax-error

NAME? error is the output for the formula shown bellow. $D$6 is a number. However whenever I click inside the formula and press 'intro' as if the cell had been modified, the formula returns the correct value.
=MROUND($D$6-9.1132,1/16)

If D6 value is less than 9.1132 you have a negative number in the left part. The right part of the formula has positive number, that's why you get the error. Please ensure both parts of your formula have the same sign. Here is the man page for this.

I had the same problem. Inserted the Formula with C# and saved it.
range.Formula = "=SUMME(A1:C3)";
When I opened the workbook it would show me the "#Name?"-Error. Once klicked in the cell manually it showed the correct formula, and when i left the cell it would show the correct calculated value instead of "#Name?"
I found out that it was a localization problem. I use the german Excel, but the formulas via Excel-Com-Interop-Library have to be inserted in english!
range.Formula = "=SUM(A1:C3)";
Once i changed this, everything worked well.

Related

SUMIFS returns 0 using dynamic criteria, with criteria range and sum range on another sheet

Anyone,
I've chatted with and called excel customer service with no luck. I used the formula builder (please see attached screenshot) to make sure each element of the formula is correct and returns the value for the criteria I'm trying to reference.
Everything is accurate, but it returns a value of 0. When I do the same thing in the actual sheet the data is stored in (and click a criteria cell within the criteria range) it returns the accurate value?! I'm not sure why it won't work on the other sheet. The values I am using to select are dynamic and change with a drop down. I have another, advanced, workbook (I did not create) that does the same thing and completes an even more complicated formula, but actually works so I'm not sure why this is returning a 0 value.
Photos and code/syntax: Dynamic Selection, Example 2 of it working, Example 1 of it working, Formula Builder, CountIFs, Advanced Spreadsheet working, VLOOKUP
=SUMIFS('GFEBS Pull'!Q:Q,'GFEBS Pull'!G:G,FMCOP!$C$20,'GFEBS Pull'!H:H,FMCOP!B23)
or:
=SUMIFS('GFEBS Pull'!Q:Q,'GFEBS Pull'!G:G,'FMCOP'!$C$20,'GFEBS Pull'!H:H,'FMCOP'!B23)
When I type ' around FMCOP sheet name, they disappear? I've also tried to lock the columns on the 'GFEBS Pull' sheet with no luck. Cell B23 is not locked because I'm going to copy the formula down to reference other cells. Any help is appreciated!
In this screenshot you can clearly see that both FMCOP!C20 ansd FMCOP!B23 have prefacing spaces; e.g. " HHC".
Since " HHC" will never match "HHC", fix the data returned from 'the lower table in the same screenshot'.
A Text-to-Columns, Fixed Width, Finish should do this. You could adjust the original formula like,
=SUMIFS('GFEBS Pull'!Q:Q, 'GFEBS Pull'!G:G, TRIM(FMCOP!$C$20), 'GFEBS Pull'!H:H, TRIM(FMCOP!B23))
I would caution against the latter 'bandaid' fix. Fix the original data; do not apply bandaids on-the-fly.

Reference cell not calculating

I am having an issue with a cell that has a formula in it, but it's not calculating. I am using Excel 2013 and the data is as follows:
I have 12 cells(z14:ab17) the user will place a numeric value in. The formulated cell has a formula that uses the numeric cells to calculate a value, but all the cell displays is #VALUE!. The formula is
=IF((ISNUMBER(SUM(Z14:AB17))),PI()/4/32^2*(Z14^2+AA14^2+AB14^2+Z15^2+AA15^2+AB15^2+Z16^2+AA16^2+AB16^2+Z17^2+AA17^2+AB17^2),0).
In the VBA side, I have
Global Const PI = 3.1415927
All the user input cells are formatted for numeric values, and the formulated cell is also formulated to calculate and display a numeric value. Can anyone help with why the cells is not calculating? This did work at one time, but now it doesn't and I have no idea what could have happened. Thanks in advance

percentile formula error in VBA

I'm trying to apply a formula through VBA for a particular range. This is the code in my VBA editor:
Sheets("WBR45").Range("AE105").Formula = "=PERCENTILE.INC(TP!$A$3:$A$30:$B$3:$B$30:$C$3:$C$30:$E$3:$E$30,50%)*24"
And the below formula gets updated in the destination cell when this is run:
=PERCENTILE.INC(TP!$A$3:$A$30:$B$3:$B$30:$C$3:$C$30:$E$3:$E$30,50%)*24
But I get an error in the destination cell as #VALUE!.
And when I click on "Show Calculation steps", only this part of the formula is underlined :
TP!$A$3:$A$30:$B$3:$B$30
I have no idea what is wrong with this simple formula. Can someone please take a look
Honestly I have no clue about what you're doing with this, but this may fix it:
"=PERCENTILE.INC(TP!$A$3:$A$30:TP!$B$3:$B$30:TP!$C$3:$C$30:TP!$E$3:$E$30,50%)*24"
You appear to have three errors in your formula:
You are using : to separate ranges instead of ,
You are not specifying which sheet the second, third and fourth ranges refer to, therefore it is defaulting to the sheet on which the formula occurs (i.e. sheet "WBR45")
Multiple ranges will need to be enclosed within brackets (...) in order to be passed as a single range.
If you are trying to have your function operate on the range A3:C30 together with the range E3:E30 (i.e. A3:E30 but ignoring column D), with those ranges being on the "TP" worksheet, I believe that you need to change your formula to
Sheets("WBR45").Range("AE105").Formula = "=PERCENTILE.INC((TP!$A$3:$A$30,TP!$B$3:$B$30,TP!$C$3:$C$30,TP!$E$3:$E$30),50%)*24"
or, slightly simplified
Sheets("WBR45").Range("AE105").Formula = "=PERCENTILE.INC((TP!$A$3:$C$30,TP!$E$3:$E$30),50%)*24"

How to link files in excel with a text in the path changing dynamically?

I have a file which needs to fetch data accordingly every week.
Let us say the formula to get data in a cell is
=\T:\Datafile\weekdata\2015\Week01\[Summary.xlsx]Sales'!D4
I have a cell in the sheet C3 which changes every week accordingly.It will change to week02 next week and i wish the path to change too..to
=\T:\Datafile\weekdata\2015\Week02\[Summary.xlsx]Sales'!D4"
I tried doing a concatenation to make the path dynamic
="\T:\Datafile\weekdata\2015\"&C3&"\[Summary.xlsx]Sales'!D4"
but it doesn't seem to work out.I checked evaluate formula and it resolves C3 to Week02 but the value doesn't come in the cell.In stead just the below text
\T:\Datafile\weekdata\2015\Week02\[Summary.xlsx]Sales'!D4
appears in the cell instead of any number.
Let me know where am i going wrong and how to resolve it.
Try =INDIRECT():
=INDIRECT("\T:\Datafile\weekdata\2015\"&C3&"[Summary.xlsx]Sales'!D4")
This function does exactly what you are trying to do, takes a built string and makes it a cell reference.
The problem with =INDIRECT() is that it only works if the source workbook is open:
If the source workbook is not open, INDIRECT returns the #REF! error value.
(That quote is from https://support.office.com/en-sg/article/INDIRECT-function-21f8bcfc-b174-4a50-9dc6-4dfb5b3361cd)
By googling "excel convert text to formula" I found this SO Q&A: How to turn a string formula into a "real" formula
If you don't like the VBA solution, I had success with
iDevlop's =EVALUATE() solution.

How to VBA change cell's value (display text) without changing its formula?

I've a problem with this VBA macro.
Sub demoChangeText()
Application.Range("B2").Value = "Overidden text"
End Sub
My test is here. To run this macro, open it in Excel, press Ctrl+F8 and choose demoChangeText.
As the result, this macro changes the value of cell B2 (the text displayed to us) but clear its formula. I need to change B2's value BUT also need the formula to be remained.
So my question is How to change the display text of cell without changing its formula?
UPDATE
I ask this question because I'm trying to solve this problem
I'm not sure if this will help, as it is a bit hard to tell what your underlying requirement is, but here goes anyway:
Several things affect the display of a cell:
the entered value, if its a constant
the result of a calculation, if its a formula
the format of the cell
the conditional format(s) of the cell, if any
In the example sheet provided you have a formula of =ROW()&COLUMN() which returns a string result of 22
You can make this display something else by applying a cell format,
eg a format of 0;0;0;Ov\e\r\ri\d\d\e\n t\ext will display any string value as Overridden text
This can by applied with VBA with
Range("B2").NumberFormat = "0;0;0;Ov\e\r\ri\d\d\e\n t\ext\s"
or
Range("B2").NumberFormat = "0;0;0;""Overridden texts"""