Nested Calculations - excel

I'm trying to make a complicated formula display its calculated values in excel formula bar.
For example this =(D9* AE9)+(A9-E9) be displayed like this =(4*0.88)+(3-1).
I would really appreciate your help on this!
Thank you in advance

The Excel Formula Bar always show the formula in the active cell - you cannot use VBA to permanently change one without changing the other.
If you select a portion of the formula (a subexpression) in the formula bar and press F9 excel will show you the result of evaluating that subexpression (remember to press Escape to revert back to the formula).
If you are looking for a way of understanding/troubleshooting complex formulas try Excel's built-in Evaluate Formula tool on the Formulas tab.
There are also more powerful formula explorer addin tools available commercially. These use formula parsers and evaluaters to show the user what the parts of the formula resolve to.

Related

How to paste in a sheet "Evaluate Formula" steps?

I'd like to know is someone knows by VBA can be accessed the content of built-in "Evaluate Formula" tool? to be able to see understand better each step of how it works a formula, since the Evaluate Formula window is too small and for array formulas, that handle many values, is needed to scroll down/up.
Maybe a way to take like screenshots or the text (like when pressed F9) of each evaluation steps from Evaluate Formula Window and paste them ordered in another sheet.
I'm tested some apps (like this one) that breaks in parts/parse the formulas but doesn't evaluates the steps.

How to evaluate a CSE formula using PhpSpreadsheet?

I'm using PhpSpreadsheet (1.15.0) to generate a XLSX document with formulas.
One of this formula is a Ctrl+Shift+Enter (CSE) formula.
When generating a document and then opening it, simple formulas (like '=SUM(A1:A2)') are evaluated. Users have nothing to deal with formulas, they just have to fill the cells.
However, I don't know how to make my CSE formula evaluated when opening. Right now, the formula is valid and correctly translated with localized functions' names, but users still have to evalute it manually by going on the cell, then in the formula bar and finally pressing Ctrl+Shift+Enter.
Isn't there any way to tell Excel, through PhpSpreadsheet, to evaluate this formula on opening?
As for example, here is my CSE formula:
=SUM(--(FREQUENCY(IF(E14:E25="CREDIT_CARD",MATCH(F14:F25,F14:F25,0)),ROW(F14:F25)-ROW(F14)+1)>0))
It seems PhpSpreadsheet can't do that right now, I don't know why.
There must be some complications about that.
But I found a pull request that fits my needs, by handling array formulas: https://github.com/PHPOffice/PhpSpreadsheet/pull/1591

excel formula sumif formula not calculating

I have used the sumif formula for many years but I find it is not working now. The report I have was first a text or pdf that was converted into an excel file. I have done the F9 key that did not work. I have checked the compatibility mode setting. The cells are number fields not text or general. I could use some expert advise how to make the formulas work.
Here is a screen shot of a sample page. The formula is in cell J6 thru J8, the formula in in the formula bar.
I think this is what you need:
=SUMIFS(C:C,A:A,I6,B:B,$J$5)
If this still gives you troubles go with:
=SUMIFS(C:C,A:A,"*"&I6&"*",B:B,"*"&$J$5&"*")
And to put it into perspective of your formula:
{=SUM(IF((A:A="*"&I6&"*")*(B:B="*"&$J$5&"*"),C:C))}

Excel doesn't update value unless I hit Enter

I have a very annoying problem in one of my worksheets in a workbook. I am using EXCEL 2007. Any cell's value will not be updated unless I hit ENTER. Either if the formula in the cell includes an if condition, or a VLOOKUP function or even an AVERAGE function. All the calculations are set to automatic, Application.Calculation = xlAutomatic, and even the calculations for the specific worksheet are enabled, like : ws.EnableCalculation = TRUE.
Furthermore, the ScreenUpdating is set to TRUE. After I hit the ENTER or I drag down the right corner, the cells will be updated, and they will keep being updated if I make any change. However, after saving the file and reopening it again they will be frozen again. I haven't figured out exactly when they will stop being updated again. All the formatting are set to General or number.
Especially in IF conditions, when I check the calculations through the evaluate feature, the result is correct but it is not passed on the screen.
Any suggestion? This thing is driving me crazy.
Executive summary / TL;DR:
Try doing a find & replace of "=" with "=". Yes, replace the equals sign with itself. For my scenario, it forced everything to update.
Background:
I frequently make formulas across multiple columns then concatenate them together. After doing such, I'll copy & paste them as values to extract my created formula. After this process, they're typically stuck displaying a formula, and not displaying a value, unless I enter the cell and press Enter. Pressing F2 & Enter repeatedly is not fun.
It sounds like your workbook got set to Manual Calculation. You can change this to Automatic by going to Formulas > Calculation > Calculation Options > Automatic.
Manual calculation can be useful to reduce computational load and improve responsiveness in workbooks with large amounts of formulas. The idea is that you can look at data and make changes, then choose when you want to make your computer go through the effort of calculation.
Found the problem and couldn't find the solution until tried this.
Open Visual Basic from Developer tab (OR right-click at any sheet
and click 'View code')
At upper left panel, select 'ThisWorkbook'
At lower left panel, find 'ForceFullCalculation' attribute
Change it from 'False' to 'True' and save it
I'm not sure if this has any side-effect, but it is work for me now.
This doesn't sound intuitive but select the column you're having the issue with and use "text to column" and just press finish. This is the suggested answer from Excel help as well. For some reason in converts text to numbers.
I have the same problem with that guy here: mrexcel.com/forum/excel-questions/318115-enablecalculation.html Application.CalculateFull sold my problem. However I am afraid if this will happen again. I will try not to use EnableCalculation again.
Select all the data and use the option "Text to Columns", that will allow your data for Applying Number Formatting
ERIK
I Encounter this problem before. I suspect that is some of ur cells are link towards other sheet, which the other sheets is returning #NAME? which ends up the current sheets is not working on calculation.
Try solve ur other sheets that is linked
I ran into this exact problem too. In my case, adding parenthesis around any internal functions (to get them to evaluate first) seemed to do the trick:
Changed
=SUM(A1, SUBSTITUTE(A2,"x","3",1), A3)
to
=SUM(A1, (SUBSTITUTE(A2,"x","3",1)), A3)
Found a simple solution.
Let's say once cell A1 is changed, so you expect cell B1 change the color by conditional formula.
Make the problematic cell - B1 has a formula with dependency to cell - A1
So, for example instead of my cell B1 just have text value "Text", i'll change it to formula like:
=IF(A1>0,"Text","Text") - means: if A1 > 0, then insert value "Text" to B1
The result is - each time cell A1 is recalculated, it forces also cell B1 color to be updated.

Excel to Google spreadsheet - formula conversion

I have the following formula that works out filtered by multiple conditions.
{=SUM(COUNTIFS('List'!$H:$H,TRANSPOSE('Assignee'!$C2:$C6), 'List'!$U:$U, 'Proceed'!$B2:$B8)))}
So I converted to google sheeets formula using ARRAYFORMULA Function for array-evaluated but it doesn't worked.
=ARRAYFORMULA(SUM(COUNTIFS('List'!$H:$H,TRANSPOSE('Assignee'!$C2:$C6), 'List'!$U:$U, 'Proceed'!$B2:$B8))))
I made a sample document. Open sheets
You can check a formula in the summary sheet.
How can I solve this?
It should work. Maybe you forgot to array-evaluate it?
Double click the cell and press Ctrl+Shift+Enter OR, wrap the whole formula with =ArrayFormula()
=ARRAYFORMULA(SUM(COUNTIFS('List'!$H:$H,TRANSPOSE('Assignee'!$C2:$C6), 'List'!$U:$U, 'Proceed'!$B2:$B8))))

Resources