axlsx: conditional formating with multiple rules, with one condition applying to another column - axlsx

I would like to develop a conditional formatting in axlsx with at least one rule applying to another column.
I.e. I have text in column A (e.g. "A", "B", "C") and data in column B (e.g. "1", "2", "3"). Is it possible to build a condition
IF colA = "B" AND colB >= 2 THEN APPLY conditional formatting to colB
within the frame of axlsx?
I hope, my pseudo code makes my intention clear.
Best regards, and thank you in advance!

Related

I would need to split only specific strings to numbers and then maximize these numbers from the specific strings in Google sheets?

Example of my google sheet spreadsheet cells below
1
AAA C1
BBB C4
AAA C7
A1: "AAA C1"
B1: "BBB C4"
C1: "AAA C7"
I would need to maximize the highest numbers after the letter "C" from all the strings that start with "AAA". I have only reached to maximize all numbers after "C" by using the formula:
=Max(ARRAYFORMULA(VALUE(REGEXREPLACE(a1:c1,"[^[:digit:]]", ""))))
Nevertheless, with the above formula I have not been able to select only the strings that start with "AAA". I have tried the function =maxifs, but it does not allow string functions such as MID being applied to the range of cells.
This is my first question here, I hope it is all clear and someone can help me with this problem.
Thanks!
Suggested Solution #1:
=Max(ARRAYFORMULA(VALUE(REGEXREPLACE(FILTER(A1:C1,ISNUMBER(SEARCH("AAA",A1:C1))),"[^[:digit:]]", ""))))
I left your original formula essentially as it was, since you already understand it as it was. All I did was replace your range with a FILTER of that range.
The FILTER alone — FILTER(A1:C1,ISNUMBER(SEARCH("AAA",A1:C1))) — keeps only those entries in the range where searching for "AAA" results in a position number (i.e., all matches for "AAA" as anything else would result in an error).
If the "AAA" must appear first in the string, you can use this version:
=Max(ARRAYFORMULA(VALUE(REGEXREPLACE(FILTER(A1:C1,SEARCH("AAA",A1:C1)=1),"[^[:digit:]]", ""))))
Suggested Solution #2:
=Max(ARRAYFORMULA(IFERROR(VALUE(REGEXEXTRACT(A1:C1,"^AAA.+(\d+)$")),-9^9)))
This will find the max from REGEXEXTRACTs matching only the "AAA" cells. If something doesn't match the "AAA" pattern, the IFERROR will return an incredibly high negative number (which will rule those out from ever being the MAX).
I think you just need to alter your REGEX expression.
^A{3}[^A].*?C(?=\d+)
^A{3}[^A] : start with exactly three uppercase A
.*?C : find the First uppercase C
(?=\d+) : the C follow by at least one number.
which will extract the part you want to replace with empty string.
e.g. AAA C1 will extract AAA C which after replace will leave you only 1.
try:
=MAX(INDEX(1*IFNA(REGEXEXTRACT(A1:C1; "^AAA.+(\d+)"))))
You mention:
...maximize the highest numbers after the letter "C" from all the strings that start with "AAA".
The mentioned answers work for a single row.
If you want to apply it to any range of rows in more complex situations you can use
=MAX(INDEX(IFERROR(
REGEXEXTRACT(FLATTEN(A1:C),"^AAA .*C(\d+)")+0)))

VBA Code Sample to Look Up Multiple Criteria

Am hoping I can get some help with a VBA code sample to look up specific values in multiple columns (4 to be exact) and populate a specific text in another column (outside of the first 4). This is all happening within 1 single worksheet. See below for 4 criteria and specified verbiage to be populated:
column 1 value: "Yes"
column 2 value: "Yes"
column 3 value: "R" or "S"
column 4 value: Begins with "9" or "88"
IF all criteria are met, then populate "AWP Review".
I use my excel in spanish, but I'll try to translate the fomula
I guess you can write this formula to filter and copy and paste later
other way would be record a macro, filtering from left to right using your criteria
if I have a wrong idea let me know
=SI(SUMA(CONTAR.SI.CONJUNTO(A2,"YES",B2,"YES"),SI(O(C2="R",C2="S"),1,0),SI(O(D2=9,D2=88),1,0))=3,"SOME TEXT","")
=IF(SUM(COUNT.IFS(A2,"YES",B2,"YES"),IF(OR(C2="R",C2="S"),1,0),IF(OR(D2=9,D2=88),1,0))=3,"SOME TEXT","")

Spreadsheet - Conditional formatting cells based on other cells

Conditional formatting a cell is simple enough. It's also simple enough to conditionally format a single cell based on another single cell. What I'm not sure about is doing it for many cells in such a way that I don't have to format each individual cell. For example:
Suppose the cells in column A either have a string, or are blank. How can I set conditional formatting on the cells in column B, such that the formatting is only applied if the A column cell on the same row (ie, the adjacent cell) is blank?
So far, I've been working around this issue by wrapping the formulas of the cells in B with IF(ISBLANK(A1),0,"FORMULA"), then applying conditional formatting to the B cells based on whether the cell values equal 0. Is there a better solution than this?
Yes, in my opinion. For LibreOffice Calc select ColumnB, Format > Conditional Formatting..., choose Formula is and enter:
A1=""
then a style of your choice and OK.
You might want to reduce the upper limit of Cell Range.
Apply the condition to Column B:
And use the following formula:
=NOT(ISBLANK($A1))
This will result in something like this:
=NOT(ISBLANK(OFFSET($A$1, ROW()-1, 0, 1, 1)))

How can I use Conditional formatting formula in the filter in the Gsheets to select 2 or more columns where cells that are not empty in both?

so I have ABCDE columns and I want to see rows of the cells that are not empty in the C as well as D column. how do I do this? I know I can have one column do that but that way it would exclude the information in the other column.
Let me know if this doesnt make sense. I'll try to explain with an example
I am a little confused by your question as to whether you are trying to use Conditional Formatting or to create a filter.
If you are trying to use Conditional Formatting:
It sounds like you are trying to highlight a row if there is not a blank cell in column C and not a blank cell in column D of that row.
Create a Conditional Formatting rule with the following:
Apply to Range A1:E1000 <-- (or however many rows of data you have)
Format cells if... SELECT "Custom formula is"
=or(NOT(isblank($C1)),NOT(isblank($D1)))
Formatting style Pick a color to highlight the row
This rule will highlight columns A-E for each row that has data in both column C and column D.

add numbers down a column in OpenRefine

I'd like to automatically number a column. Similar to Excel, where I can type "1" in one cell and the cells below it automatically get numbered 2, 3, 4, 5, etc. I don't know why I'm having so much trouble figuring out this function on Openrefine but any help would be greatly appreciated.
Thanks,
Gail
You can add a new column ("Add new column based on this column") with this Grel formula inside :
row.index + 1
The answer by Ettore Rizza already provides a solution for the common case. As the question author stated in a comment it does not work for his use case. He wants to add consecutive numbers to unfiltered rows.
For this you can use records. The basic idea is to create records from the filtered data and use the record index as counter.
Steps:
With filters active add a new column with the expression value.
Move the new column to the beginning to use it as records.
With filters still active add a new column (or transform the first one) with the expression row.record.index + 1.
Original
Filtered
Records
Index
A
A
A
1
1
2
B
B
B
2
C
C
C
3