Formula to divide count if - excel-2010

Good day,
I have a countif(concatenate)) and another countif(concatenate). I am looking for a formula that takes the first countif total and the second countif total and dividing the answer of the two.
Help would much appreciated.
Thanks.

From the tag i suggest that you use Excel 2010. Let us assume that you already got the value of countif(concatenate1) in a cell called A1 and the value of countif(concatenate2) in a cell called A2.
A formula to divide A1 by A2 and store the result in A3 would be:
=A1/A2 (place this code in cell A3).
You might want to look into this, too: https://support.office.com/en-us/article/COUNTIF-function-e0de10c6-f885-4e71-abb4-1f464816df34

Related

Repeating a value on the basis of count provided in another cell - Google Sheets

I'm trying to write a formula where I can generate a number n number of times where n can be the input provided by the user.
=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(QUERY(
REPT($D2&",", $E2), ), ","))))
Ideal output
Here D2 is the value to be repeated and E2 is the number of times.
So instead of manually using this formula after each last repeated value to generate the next set of repeated values, I want to print the values in one go. I'll be really grateful, if anyone could please provide a way around to do the same. Thanks in advance.
Try this
=ARRAY_CONSTRAIN(arrayformula(query(flatten(split(rept("|"&D2:D,E2:E),"|")),"select * where Col1 is not null")),SUM(E2:E),1)
explanation
the core of the formula is
=arrayformula(iferror(split(rept("|"&D2:D,E2:E),"|")))
then, apply flatten with a limitation of rows (ARRAY_CONSTRAIN) equal to the sum of column E, and query only the rows that are not null
Try the below formula:
=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(QUERY(
REPT(D2:D&",", E2:E), ,999^99), ","))))

Google Sheet SUMIF not summing range

I am trying to SUM all rows based on the condition that a row's value is greater than 0. However, the formula is only calculating the first row and ignoring the rest of the range. I encountered this issue on a different spreadsheet but I isolated the issue on a new spreadsheet to show you and ask questions.
The answers should be B1 ($5), B2 ($15), B3 ($30).
I followed the formula's usage as explained in the Google Docs https://support.google.com/docs/answer/3093583?hl=en
The formula with respective row number =SUMIF(A1, ">0", A$1:A1)
Update - The below is my intended purpose. I have a spreadsheet that calculates money In and Out. For each of these transactions, I simply want the balance as a result of such transactions. This only works for the first row. (I hardcoded the values for the rest of the rows just to show my goal.)
try:
=ARRAYFORMULA(IF(A:A="",,SUMIF(ROW(A:A), "<="&ROW(A:A), A:A)))
if you prefer dragging do:
=SUMIF(INDIRECT("A1:A"&ROW()), ">0")
UPDATE:
=ARRAYFORMULA(IF(D2:D="",,
SUMIF(ROW(D2:D), "<="&ROW(D2:D), D2:D)-
SUMIF(ROW(E2:E), "<="&ROW(E2:E), E2:E)))

variable columns with countif result in formula parse error

When I use this formula it gives me "formula parse error"
=COUNTIF(sheet2!"&A1&"$1:"&B1&"$4, "*x*")
on sheet1 the cell A1=C and B1=D
on sheet2 the range C1:D4 contains 2 times x.
in trying to make Google Sheets understand the code needs to be:
=COUNTIF(sheet2!C$1:D$4, "*x*") and result into number 2 because of 2 times x.
I want to change cells A1 and B1 on sheet 1 to lets say X and Y
and the code would update to:
=COUNTIF(sheet2!X$1:Y$4, "*x*")
but i only get formula parse errors...please help if possible,
much love
You need to use indirect for this:
=COUNTIF(indirect("sheet2!"&A1&"$1:"&B1&"$4"), "x")

Duplicating data in one cell as per repeat counter

I got into a bit of problem. I have data like this
Date Repeat
7-Oct-2018 1
8-Oct-2018 1
9-Oct-2018 2
10-Oct-2018 2
11-Oct-2018 3
12-Oct-2018 2
13-Oct-2018 1
Now the result i want is a column where the date is repeated as per the repeat numbers, like this.
Result
7-Oct-2018
8-Oct-2018
9-Oct-2018
9-Oct-2018
10-Oct-2018
10-Oct-2018
11-Oct-2018
11-Oct-2018
11-Oct-2018
12-Oct-2018
12-Oct-2018
13-Oct-2018
So how can i get this result. Please do help
I tried to think of it for own study. For example, how about this sample formula? I think that there might be simpler formulas. So please think of this as one of them. When you use this, please put the following formula to a cell.
=TRANSPOSE(SPLIT(JOIN(",",ARRAYFORMULA(REPT(A2:A8&",",B2:B8))),","))
This formula supposes that the values of Date and Repeat are put in A2:A8 and B2:B8, respectively.
Show repeatedly Date using REPT(). At this time, , is used as a delimiter.
Join each cell with , using JOIN().
Split the cell with , using SPLIT().
Transpose the cells using TRANSPOSE().
I think that you can also use CONCATENATE() and TEXTJOIN() for joining cells.
References:
REPT
JOIN
SPLIT
TRANSPOSE
CONCATENATE
TEXTJOIN

Google spreadsheet formula to resolve string as a cell

Using google spreadsheets is there a way to evaluate a cell value as the row in a lookup operation? For example rather than =D2 to grab the value of D2, I want to evaluate the value of a cell and use it as the row to lookup another cell. I've looked at the google spreadsheet formula documentation and haven't been able to find a solution.
The below pseudocode illustrates what I'm trying to do.
A B C D
1 D
2 =[B1]2 10
3 =[B1]3 9
4 =[B1]4 8
Given the value of B1 is "D" I want cells B2, B3, and B4 to resolve to 10, 9, and 8 respectively.
You might be looking for something like this:
=INDIRECT(INDEX(B$1;1;1)&ROW())
the INDEX(B$1;1;1) gets content of B1 cell (the 1;1 is obligatory parameter, since you can feed INDEX with range and means: 1st row in range;1st column in range which is D
ROW() returns current row number, be it 2, 3 etc.
& concatenates both value, so the result is processed like "D" & "2" => "D2"
INDIRECT(reference) returns reference to a cell or an area (in text form) for which to return the contents.
see https://support.google.com/drive/table/25273?hl=en
Still, depending on what is the original problem, there might be better solutions. Above one is just straightforward answer to your question.
Bearing in mind the correctness and helpfulness of PsychoFish's advice on the use of INDEX() with INDIRECT(), and on the limited usefulness of any one solution for all problems, I think the following formula will work as well in this particular case:
=INDIRECT(B$1&Row())

Resources