after a deep search on the internet i gave up.
My "simple" question would be: How can I add two ranges in a formula, preferably in MATCH?
I want to search a range like A1:A7 + A9:A20 and thus not include A8 in my range.
Is this possible? Please help me out
If cells you need to exclude from the summing locating in discontinuous cells, for example, you need to exclude values in cell A3 and A6 while summing range A2:A7, please apply this formula: =SUM(A2:A7)-A3-A6.
The MATCH function searches for a specified item in a range of cells, and then returns the relative position of that item in the range. For example, if the range A1:A3 contains the values 5, 25, and 38, then the formula =MATCH(25,A1:A3,0) returns the number 2, because 25 is the second item in the range.
In Excel, <> means not equal to. The <> operator in Excel checks if two values are not equal to each other.
Natively you can't but you could try to bypass it with either:
Exclude a single cell:
If you want to exclude a certain cell from a MATCH
you can exclude it's certain row number like so:
=MATCH(1,(A1:A20="X")*(ROW(A1:A20)<>8),0)
Or
=MATCH(1,INDEX((A1:A20="X")*(ROW(A1:A20)<>8),),0)
Both are array formulas but only the first one needs to be confirmed by holding down Ctrl+Shift before pressing Enter
Exclude a range of cells:
If you would want to exclude a range of rows, e.g. 8-12, then we cannot use the AND
or OR
logic as they don't return an array. However, we can mimic it ourselves like:
=MATCH(1,(A1:A20="x")*((ROW(A1:A20)<8)+(ROW(A1:A20)>12)),0)
Or
=MATCH(1,INDEX((A1:A20="x")*((ROW(A1:A20)<8)+(ROW(A1:A20)>12)),),0)
Where, again, both are array formulas but only the first one needs to be confirmed by holding down Ctrl+Shift before pressing Enter
Alternative
Alternatively, you could stack MATCH
functions in a number of ways, but here is one of them:
=IFERROR(MATCH("x",A1:A7,0),MATCH("x",A13:A20,0))
Good luck =)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With