In this former post, Taosique kindly provided a solution to make numbering cell empty on ONE condition, skip numbering for this cell, and take it back on subsequent relevant cells, in a way that rows can be moved around and the (relative) numbering adapted.
Basically, if adjacent B cell = Value 3, make A cell empty, and skip numbering; then take back relative numbering.
| Row nbr | B col. | [Explanation] | |---------|:-------:|-------------------------------------| | R01 | Value 1 | | | R02 | Value 1 | | | R03 | Value 2 | | | | Value 3 | Col. B value = 3 => Col. A is empty | | R04 | Value 2 | Numbering takes up | | R05 | Value 1 | | | | Value 3 | Col. B value = 3 => Col. A is empty | | R06 | Value 2 | Numbering takes up | | ETC. | | |
This works great:
=IF(INDIRECT("B"&ROW())="Value 3","",ROWS(INDIRECT("B"&10&":B"&ROW()))-COUNTIF(INDIRECT("B"&10&":B"&ROW()),"Value 3"))
..as can be seen on the example spreadsheeet.
Now I need to take this one step further, and apply that same logic with multiple (OR) conditions, so numbering gets skipped if B cell value = "Value 3" OR "Value 2" (not just "Value 3").
I tried adapting the formula here:
=IF(OR(INDIRECT("B"&ROW())="Value 3";INDIRECT("B"&ROW())="Value 2";"";ROWS(INDIRECT("B"&10&":B"&ROW()))-COUNTIFS(INDIRECT("B"&10&":B"&ROW());"Value 3";(INDIRECT("B"&10&":B"&ROW());"Value 2"))))
The first OR condition seems ok ; I switched COUNTIF to COUNTIFS, so I could use multiple criteria, but this gives an error. Maybe because I'm mixing COUNTIFS and INDIRECT? Because even this last part alone throws an error:
=COUNTIFS(INDIRECT("B"&10&":B"&ROW());"Value 3";(INDIRECT("B"&10&":B"&ROW());"Value 2"))
Sorry if I'm missing the obvious.