I have a google sheet, I apply conditional formatting rules to each row, and the first column appears to be formatting correctly, but the rest of the columns seem to not be.
Look at I6 for example, it should be green because it's less than B6, but it's red.
use "custom formula" and use:
=D6=$B6
on range D6:O
for red use:
=D6<>$B6
Related
I am using an arrayformula to add .png suffix to the text in column A. Right now it looks like this:
=arrayformula(A:A &".png" )
Since I want this to be a part of a macro, I won't manually be able to choose the exact range.
So how do I limit the formula, to only add the suffix, if the cells in column A had any text in it, to begin with? Right now I end up with a lot of cells where it just says ".png" because the cell was empty.
I have tried playing around with =if(istext(A:A) but I couldn't figure out how to construct the statement. And maybe it is not the way to go?
try:
=ARRAYFORMULA(INDIRECT("A1:A"&COUNTA(A:A))&".png")
or shorter:
=ARRAYFORMULA(IF(A:A="",,A:A&".png")
or regex:
=ARRAYFORMULA(REGEXREPLACE(A:A, "(.+)", "$1.png"))
See if this helps
=Arrayformula(if(len(A:A), A:A&".png",))
Using below code
=ARRAYFORMULA(A1:A&".png")
should do the thing.
I am trying to find the "real" formula of a group. For example, these are the formulas
=If(A$4>$A1,"Long","Short")
=If(B$4>$A1,"Long","Short")
=If(A$4>$A2,"Long","Short")
=If(A$4>$A$2,"Long","Short)
The forth formula is a different one. The first 3 formulas should be the same formula that is a cell fixed 4th row compare to a cell fixed at column A. The result should show 2 "real" formula. Something like this
=If($4>$A,"Long","Short")
=If($4>$A$2,"Long","Short")
How do I design a regex (or any other method) in VBA to extract that "real" formula from the "nominal" formulas?
Convert your formulas to display in R1C1 format by using File,Options,Formulas and ticking R1C1 style. In such a style your four example formulas would display (If they were entered in column 3) as
=IF(R4C[-2]>RC1,"Long","Short")
=IF(R4C[-1]>R[-1]C1,"Long","Short")
=IF(R4C[-2]>R[-1]C1,"Long","Short")
=IF(R4C[-2]>R2C1,"Long","Short")
The fixed portions of the addresses don't have braces [] so if you remove the braces and their contents you get
R4C>RC1
R4C>RC1
R4C>RC1
R4C>R2C1
and no 4 is different from the others
I need help with what I'm sure is a simple formula that I just don't understand.
I have three columns. The first two hold my values and the third is meant to subtract them. However, when the first column is blank, I would like the third to also be blank. I have it close right now but when I type 0 in the first column, it treats that as a blank cell instead of using the 0 to give the sum.
Ex. of what I would like
expected result:
I can't seem to figure out the formula for the third column.
Yes this is a quirk that goes right back to the dawn of spreadsheet applications; in an empty worksheet the formula =A1 written anywhere other than the top left cell will evaluate to 0.
One way, in Google Sheets, is to use something like
=IF(ISBLANK(A1), ,A1 - B1)
In Microsoft Excel you need to use double quotations characters in the second argument, noting that this injects a blank string into the output.
This if statement (put in the 3rd Column) checks the first column if blank then just set cell as blank else perform the subtraction:-
=IF(A1="", "", A1-B1)
I wanted to apply conditional formatting to any cell in column A with text 0.0 in it, so I made this custom formatting rule:
However I want the highlight to apply to entire row not just the cell, any ideas?
Conditional formatting rules' formulae are applied like dragging a formula around the range to be formatted, including the rules of absolute and relative reference.
You want to apply to A2:Z or whatever column comes last and the rule will be =REGEXMATCH($A2, "0.0").
Note the $ for the column, otherwise it will check B2 for column B.
I'm trying to apply a formula without having it add the formula data to each and every cell - in other words, I need the cells that are receiving the formula to be untouched until they get their data.
I was searching around and it looked like an ARRAYFORMULA would work but it doesn't seem to be doing anything when I apply it.
For example, I want to apply this formula to a cell range: =SPLIT(E2, ",")). Each cell in the E column needs to be split into two the two adjacent cells next to it based on it's comma. When I try to apply =ARRAYFORMULA(SPLIT(E2:E99, ",")) only the cell I add this to gets the formula.
In addition to the contribution of pnuts, also try:
=ArrayFormula(iferror(REGEXEXTRACT(","&E2:E,"^"&REPT(",+[^,]+",COLUMN(OFFSET(A1,,,1,6))-1)&",+([^,]+)")))
Note: the last parameter of OFFSET can be changed to match the maximum number of values you have in the cells of the range E2:E (separated by a comma). E.g: if you have a no more than 3 values per cell, set it to three. The output will then be three columns wide (one column for each value).
Hope that makes sense ?
Also credits due to AdamL who (I believe) orginally crafted this workaround.
I think what you want may be array_constrain but for your example I can only at present offer you two formulae (one for each side of the comma):
=Array_constrain(arrayformula(left(E2:E,find(",",E2:E)-1)),match("xxx",E:E)-1,1)
=Array_constrain(arrayformula(mid(E2:E,find(",",E2:E)+1,len(E2:E))),match("xxx",E:E)-1,1)