Excel to Google spreadsheet - formula conversion - excel

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))))

Related

Nested Calculations

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.

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))}

Working SUMPRODUCT function on Google Sheets does not work in Excel

I have a function here that is meant to calculate how many leads I have in each country.
=sumproduct($A2=(vlookup(id_leads!$A:$A,country_leads!$A:$B,2,0)))
On sheet id_leads,$A:$A contains the lead ids
On sheet country_leads Column A contains the lead ids. Column B contains the country of which the lead is located.
Can someone explain why it fails in Excel (I get a #VALUE! error), but works fine in Google Sheets? A suggestion to make this formula work in Excel would be appreciated. I've tried to use COUNTIF and SUMIF, but couldn't figure it out.
Thanks in advance!
You need to use COUNTIFS() wrap by SUM() in an array formula, something like:
=SUM(COUNTIFS(D:D,B1:B3,E:E,A1))
Being an array it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly then Excel will put {} around the formula.
Note the 2nd and 4th criteria need to be limited to the data set and not a full column reference.
So your formula would be something like this:
=SUM(COUNTIFS(country_leads!$A:$A,id_leads!$A1:$A100,country_leads!$B:$B,$A1))

Formulas won't calculate automatically

I have a big sheet with a lot of formulas that have a dependency hierarchy between them. It starts with a cell with a date value. Then, cell x:y (and others), has formula depending on this date. Then cell w:z (and others) has a formula depending on cell x:y. And so on...
This main cell with a date value is filled using apache poi.
And now my problem: when I open the generated excel file, the date is there, but none of the formulas are calculated. They all have the error "A value used in the formula is of the wrong data type". It seems that when the formula try to evaluate it self the date isn't there yet.
Solutions:
1) If I click in the cell, and just press ENTER, the formula is correctly evaluated. But then I would have to do this for all cells.
2) I click in the date cell, copy it, and then paste it in the same place, and all formulas in the sheet are evaluated!
3) I could iterate in all cells in my application, evaluating each one with evaluateFormulaCell method from FormulaEvaluator class. But I have a lot of formulas and the performance of this is terrible.
Does someone have a solution for this?
Thanks!!
Your date value isnt recognized by the excel formulas as a date, what you could do is have another cell dat will first take the datevalue DATEVALUE() of the cell filled using Apache poi.
Then direct your first level formulas to that cell instead of the one filled using Apache poi
Because Excel don't calculale automatically, so just change this.
Excel 2010: File -> Options -> Formulas: Find Workbook calculation, and change to Automatically.
It worked for me.
To solve this, I changed all formulas in my template, to use instead of the regular formula sintax (=SUM(A:D)) the following sintax:
$[SUM(A:D)]
http://jxls.sourceforge.net/reference/formulas.html

Resources