I can't sum the values of a column whose values are generated using if statement - function

Sum function is not helping me sum the column, i even tried to manually enter all the cells but that also does not help. Even if there is values in the column, I get 0 as the answer in the cell where I have entered the sum function.

I have the following condition for 10 cells in a column =IF(B1=0,20,2) and then the sum for the cells =SUM(A1:A10). The column is autoupdated when B1 is updated and also the sum is updated when the values of the cells change.
If you have different workbooks the if changes to this =IF([d.xlsx]Tabelle1!$A$1=0,2,10). Where d.xslx is the name of the second workbook where you check the value Tabelle1 is the name of the sheet and $A$1 is the checked cell.

Make sure your IF formula does not have "" around your values. For example, make sure it looks like this: =IF(A1="Y",1,0)

Related

I need a Google Sheets script & formula regarding looking up a dynamic value from a range of cells and using that value in a formula elsewhere?

I would like to have a script that runs upon change in values to the sheet. What I have setup on my sheet is a few cells in a column that can have dynamic values typed into one of them (ex. J6:J10). I would like the script to run and check for a dynamic value in one of the cells, which it would then use that value in a formula contained in a different cell (I6) to calculate a formula similar to this: =ROUND(J6/E6,2). Cell J6 being dynamic.
I need the formula to be dynamic to match whichever J cell row has data and correlate to the E cell row
I was only able to get the sheet setup with its basic layout. I am still missing a working script that functions with the proper dynamic formula
If only 1 of the cells in J6:J10 has the value which you want to work with you could use in I6:
=ROUND(SUM(J6:J10)/E6,2)
What about this? It calculates all the ratios, and FILTER if J is empty; and finds the minimum ratio with MIN:
=IFNA(MIN(FILTER(INDEX(J6:10/E6:E10),J6:J10<>"")))

Can I show the results of COUNTIF in one column only if there is data in another column?

I have a spreadsheet with multiple sheets.
Sheet A is generated from a template, and it is where users will enter in data to be formatted into a report; it will be deleted after that report is submitted.
As people enter info into Column A of Sheet A, they don't have to enter client information if we already have them entered in this spreadsheet, but otherwise they need to go over to Sheet B and enter it in.
To make it easier for them (so they don't have to check every time, or go back and enter info later after getting an error generating the report), I have used conditional formatting. The way it works is, column Z is set up as a helper column, and uses a "COUNTIF" function to check if the client ID in Sheet A, Column A is found in Sheet B, Column C. Sheet A Column Z returns 0 or 1 (or, theoretically, more than one if we had duplicates), and then Sheet A column A has conditional formatting based on Column Z's value-- if the client is already in, the cell for client ID turns green after they type it; if not, it turns red.
It works great! However, I am adding scripts to these sheets, and looping through them. This helper column is filled from Z1 to Z1000, which means I can't use sheet.maxRow() to get the last row.
I see plenty of workarounds on the script side, but I was wondering if anyone has a clever way to input a value into the helper column Z ONLY IF the corresponding cell (same row) in column A has a value using spreadsheet formulas.
I suspect that an array formula with a filter might do it, but I have little experience with either and can't get anything to work out.
Thanks for your help!
You can use this expression with INDEX, MAX and ROW to make an ARRAYFORMULA only expandable until the last cell with value in column:
A2:INDEX(A2:A,MAX(ROW(A2:A)*(A2:A<>"")))
It will go from A2 to the maximum number of row in A in which A is different than null (that's why both conditions are multiplied).
Then you can set a formula like this in Z2 (check the ranges in case something is not right from reading your text, and delete all other formulas in Z too in case you weren't using an arrayformula already):
=BYROW(A2:INDEX(A2:A,MAX(ROW(A2:A)*(A2:A<>""))),LAMBDA(each,IF(each="","",COUNTIF('Sheet B'!C:C,each))))

Pull Entire column from different sheet without zero's

how to pull column from different sheet..
I've a sheet using the below formula to get the column(n rows) from Sheet1 to Sheet2 however I'm getting zeros after nth row. How to avoid zeros here ??
=IF(NOT(ISBLANK(Sheet1!C1)),Sheet1!C:C,"")
I'm doing the same for A,B,C columns to get data from Sheet1 to Sheet2. Any better formula ?
zeros are coming because the original column doesn't have data after nth row. for example if zero occur at 301 for column c means data in the column C has values upto 300 rows.
we can avoid this issue in two ways
stop copying formula after you get zeros
or
Put a unique word in the formula (here stopcopying)
=IF(LEN(IF(NOT(ISBLANK(Sheet1!C12)),Sheet1!C:C,""))=0,"stopcopying",IF(NOT(ISBLANK(Sheet1!C1)),Sheet1!C:C,""))
Find "Stopcopying" keyword and replace without giving any word ( ctrl F and R)
This is the only way I can see and this answered my question:
=FILTER($B:$E,(B:B<>""))

Counting same values between rows in Open Office Calc

(Open Office Calc) I have two rows of the same length, containing letters.
Suppose the two rows are A1:Z1 and A2:Z2.
I want to check if A1=A2, B1=B2, ... Z1=Z2 and output in one cell how many of these conditions are true.
I tried using COUNTIF but the condition can only refer to a fixed cell, not to a "moving" cell. In this case I would like to be able to write something like "COUNTIF(?1= ?2)" where "?" is the column index.
Any ideas?
Please try:
=SUMPRODUCT(A1:Z1=A2:Z2)

Excel - Advanced Sorting Function

I have a tournament spreadsheet that has a list of names in column "D" (between 20 and 150 entries) and the table number that each person is assigned to (column "E").
In column "I", I have a ridiculous formula that creates a list of the number of seats available at each table (this information changes from one event to another).
Column "G" is my problem. I want to run through the contents of column "E" and anytime there is a value in column "E" that matches the contents of column "I", to give the the contents of column "D".
Here is my formula as it currently stands in cell G3:
{=IFERROR(INDEX(D$3:D$150,SMALL(IF(E$3:E$150=I3,ROW(E$3:E$150)-ROW(E$3)+1),ROWS(E$3:E3))),"")}
The formula works perfectly for all values in column "E" as long as the value in column "E" is 1. This formula works beautifully in Google Sheets but Excel seems to process the ranges differently. I've tried with both a standard formula and an array formula without success.
Any advice would be greatly appreciated.
One additional note, I can use VBA if needed but I would prefer to stick with functions.
for this example I used the following formula:
=INDEX($C$14:$C$25,AGGREGATE(15,6,(ROW($D$14:$D$25)-ROW($D$14)+1)/($D$14:$D$25=H16),COUNTIF($H$16:H16,H16)),1)
You will need to adjust the ranges to suit your needs.
From my testing, the problem appears to be with the ROWS(E$3:E3) as the second argument for the SMALL function. Basically, when you get down to your first 2 in row 12, you are asking the small function for the 10th smallest value in D that has 2 in column E. Since it looks like you are only expecting eight players, this will never find anything.
Try changing ROWS(E$3:E3) to COUNTIF(I$3:I3, I3).
That will count how many 1's or 2's you've already passed in column I, so when you get to the 2's, it should reset and ask for the first smallest.
#Forward Ed. Thanks for your input. That helped get me on the path that I needed.
Here is the formula that ended up working for me:
{=IFERROR(INDEX(D$3:D$150,SMALL(IF(E$3:E$150=I3,ROW(E$3:E$150)-MIN(ROW(E$3:E$150))+1),J3)),"")}