Hi I have 2 formulas in google sheet that works great alone, but how can I put it together and get 1 result in the same cell, not side by side when we use "&"
Formula 1: =COUNTIFS(B1,"<>")*1-COUNTIFS(E1,"<>")*0
(when I have some text in cell B1 and E1 just count cell B1)
Formula 2: =(COUNTIFS(B1,"")*0+COUNTIFS(E1,"<>")*1)
(when I have some text in cell E1 and B1 is blank just count cell E1)
Already tried: =COUNTIFS(B1,"<>")*1-COUNTIFS(E1,"<>")*0&(COUNTIFS(B1,"")*0+COUNTIFS(E1,"<>")*1) unwanted result: 1 1 in the same cell
try:
=IF((B1<>"")*(E1<>""), 1,
IF((E1<>"")*(B1 =""), 1, 0))
Related
If cell C rows is between the numbers 0 - 3.9, cell D rows would input the number 7. If cell C rows are 4 - 7.9, it would input 10 on cell D rows. If cell C rows are 8 - 14.9 it would input 15 on cell D rows.
I was thinking it would be similar to:
=IF(C1>0-3.9,”7”,””)
use:
=IFNA(VLOOKUP(C1, {0,7;4,10;8,15}, 2, 0))
Set-up
I have 2 Google Sheets tabs; Vertical and Horizontal.
Data in Vertical is noted vertically, that is,
A1 = X
A2 = Y
A3 = Z
etc.
I want the data from Vertical horizontally in Horizontal, that is
A1 = Vertical!A1 = X
B1 = Vertical!A2 = Y
C1 = Vertical!A3 = X
etc.
Isssue
When I set A1 = Vertical!A1 and drag the field horizontally to fill B1, C1,... I get,
A1 = Vertical!A1 = X
B1 = Vertical!B1 = empty
C1 = Vertical!C1 = empty
etc.
that is, instead of incrementing the number, Sheets increments the letter.
Question
How do I get Sheets to increment the number instead of the letter?
Simply copy+paste special -> transpose doesn't work between 2 sheets, it seems.
Googling around I see a lot of fancy formulas that don't do what they say?
Tried:
https://stackoverflow.com/a/30003770/7326714
https://webapps.stackexchange.com/a/126830
https://webapps.stackexchange.com/a/126844
use this and drag to the right:
=INDIRECT("Vertical!A"&COLUMN(A1))
you can use TRANSPOSE
=TRANSPOSE(vertical!A:A)
Transpose auto fill the others cells so there is no need to drag
I have arrayformula in the first row of a column so my values and calculations can start in Row 2 and for all the column length.
I have this situation:
https://docs.google.com/spreadsheets/d/11oDra7Vja4-5C0Uix7JTgLLSMG3gPj-6fkajXlWqqQk/edit?usp=sharing
I need a simply arithmetic operation:
Subtract above value of the same column for every row.
I'm using:
=arrayformula(IF(row(A:A)=1; "What I have now"; IF(ISBLANK(A:A); ""; A1:A-A2:A)))
but as you see is wrong.
How to do that?
UPDATED QUESTION:
And then in the second sheet I need a SUM operation with some blank cells in column:
How to do that?
https://docs.google.com/spreadsheets/d/11oDra7Vja4-5C0Uix7JTgLLSMG3gPj-6fkajXlWqqQk/edit#gid=931743679
If you want to have the array formula ion the header this is a bit weird as you need to allow the formula to technically access row 0, we can do this by constructing ranges.
=ArrayFormula(IF(
--(ROW(A1:A) > 2) + -ISBLANK(A1:A) = 1;
{0; A1:A} - {0; A2:A; 0};
""))
--(ROW(A1:A) > 2) + -ISBLANK(A1:A) = 1 Checks if the row is populated and not one of the first two rows in a way that works nicely with array formulas
{0; A1:A} - {0; A2:A; 0} does the following:
0 Data 156 123 110 95 42
- - - - - - -
0 156 123 110 95 42 0
= = = = = = =
0 33 13 15 53 42 42
N N Y Y Y Y N <- Is shown
^ ^ ^
| | Because Row is blank
| |
Because row not > 2, thus it is never evalauated even though the second would cause an error
I think this is quite tricky. The problem is that in an array formula the number of cells in each array must match - you can't mix an array starting in row 1 with an array starting in row 2 if they go all the way to the bottom of the spreadsheet.
Here is one way of getting the result you want
=arrayformula({"What I need";"";offset($A$1,1,0,count(A:A)-1)-offset($A$1,2,0,count(A:A)-1)})
You will need to change the ; and , for your locale.
I have built up an array using the {} notation to define the elements. In my locale a ; means go to the next row, so I have defined the first two cells directly as strings. After that I've chosen to use Offset to get the range A2:A5 (1 row down from A1, 0 rows across and 4 cells high) and subtract the range A3:A6 (2 rows down from A1, 0 rows across and 4 cells high) it so that gives me the other 4 cells.
B1 "What I need"
B2 ""
B3 A3-A2=33
B4 A4-A3=13
B5 A5-A4=15
B6 A6-A5=53
but will need an IF statement adding if there are any blank cells between the numbers.
In the particular case of your updated question where there are fewer numbers in column D than column C, the formula would be
=arrayformula({"Special Case";"";offset($D$1,1,0,count(D:D))+offset($C$1,2,0,count(D:D))})
But in the general case of there being blank cells anywhere, you would have to test everything
=arrayformula({"General Case";"";if(offset($D$1,1,0,rows(C:C)-2)="","",if(offset($C$1,2,0,Rows(C:C)-2)="","",offset($D$1,1,0,rows(C:C)-2)+offset($C$1,2,0,Rows(C:C)-2)))})
I've got a sumif at the start of every row of my data adding up numbers if they are >0 and another doing the same for numbers <0 like this:
=SUMIF(P6:X6;">0")
This works and all but it's quite a pain to drag the cel down every time I add more data. Is there a way for me to turn this into a ARRAYFORMULA that just keeps going down.
The formula for sums ">0" is:
=arrayformula(mmult(A2:C*--(A2:C>0), transpose(A2:C2 * 0 + 1)))
and for sums "<0":
=arrayformula(mmult(A2:C*--(A2:C<0), transpose(A2:C2 * 0 + 1)))
transpose(A2:C2 * 0 + 1)) is an array of 1: [1, 1, 1, ...] It's the part of mmult function to convert the result into row.
--(A2:C>0) double minus is for converting booleans into 1 (if true) and 0 (if false)
How would i go about counting the scores between C1 and C8 and entering the values into A2 and B2?
a1 = blue
b1 = red
a2 = team blue score
b2 = team red score
between c1 to c8 = winning team & score (NOTE: c1 = $a$1&" 1.25" )
c1 = blue 1.25
c2 = blue 2
c3 = red .5
c4 = draw
c5 = blue 1.5
c6 = blue 1.75
c7 = red 2
c8 = draw
So what I should get is:
A2 should = 6.5
B2 should = 2.5
You can get the total score of the blue team with
=sum(arrayformula(if(left(C1:C, 4)="blue", value(regexreplace(C1:C, "[^0-9.]", "")), 0)))
For the red team, use left(C1:C, 3)="red" in the formula.
The conversion from text to number happens in two steps: regexreplace removes all characters except . and 0-9; then value converts text to number.
It would be better to keep the winning team and their score in separate cells (team in column C, their score in column D), which would simplify the handling of this data: you'd only need =sumif(C1:C, "blue", D1:D).
Taking help of helper columns and without Array formula.These formula can adapt if you change team to Green or any other colour.
Formula in D1:(And Fill down)
=VALUE(RIGHT(C1,(LEN(C1)-LEN($A$1))))
Formula in E1:((And Fill down)
=LEFT(C1,(MIN(FIND({0,1,2,3,4,5,6,7,8,9},C1&"0123456789"))-2))
(And Fill down)
Formula in A2:
=SUMIF(E1:E9,"blue",D1:D9)
Formula in B2:
=SUMIF(E1:E9,"red",D1:D9)