Frankroger
New Member
- Joined
- Nov 16, 2023
- Messages
- 21
- Office Version
- 2013
- Platform
- Windows
I'm trying to get the position of column A, by finding the absolute minimum difference between column ranges C and D
Formula in cell H3, works, but then breaks down when error cells are included in the ranges
In this example, the smallest absolute difference between ranges C1:C6 and D1:D6 was cells C3 and D3, as the difference between these two cells was the smallest.
The formula then returned to me cell A3, value 3, which is correct.
But if we include #N/A cells in the ranges, it fails.
The formula in H1, omits the errors, and returns to me the smallest absolute difference between columns C and D, but I can't get it to return the position from column A
So either I need to be able to add an index match function to the formula in H1, to return the position from column A
Or I need to be able to add the ignore errors function into the formula in H3
I've been unable to solve
Formula in cell H3, works, but then breaks down when error cells are included in the ranges
In this example, the smallest absolute difference between ranges C1:C6 and D1:D6 was cells C3 and D3, as the difference between these two cells was the smallest.
The formula then returned to me cell A3, value 3, which is correct.
But if we include #N/A cells in the ranges, it fails.
The formula in H1, omits the errors, and returns to me the smallest absolute difference between columns C and D, but I can't get it to return the position from column A
So either I need to be able to add an index match function to the formula in H1, to return the position from column A
Or I need to be able to add the ignore errors function into the formula in H3
I've been unable to solve
help.xlsx | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | |||
1 | 1 | 10 | 20 | 10 | 2 | The formula omits #N/A error cells and finds the smallest absolute difference between columns C and D, which was 2, but I need it to return the position from cell A3 | |||||||||||||||||||||||||||||
2 | 2 | 10 | 20 | 10 | |||||||||||||||||||||||||||||||
3 | 3 | 7 | 9 | 2 | |||||||||||||||||||||||||||||||
4 | 4 | 10 | 20 | 10 | 3 | This formula does what I'm trying to do! , It find the smallest difference between colums C and D and returns the position from Column A, but it doesn't omit #N/A cells! | |||||||||||||||||||||||||||||
5 | 5 | 10 | 20 | 10 | |||||||||||||||||||||||||||||||
6 | 6 | 10 | 20 | 10 | |||||||||||||||||||||||||||||||
7 | |||||||||||||||||||||||||||||||||||
8 | |||||||||||||||||||||||||||||||||||
9 | |||||||||||||||||||||||||||||||||||
10 | 1 | 10 | 20 | 10 | #N/A | #N/A values in ranges breaks the formula | |||||||||||||||||||||||||||||
11 | 2 | 10 | 20 | 10 | |||||||||||||||||||||||||||||||
12 | 3 | 7 | 9 | 2 | |||||||||||||||||||||||||||||||
13 | 4 | 10 | 20 | 10 | |||||||||||||||||||||||||||||||
14 | 5 | #N/A | 20 | #N/A | |||||||||||||||||||||||||||||||
15 | 6 | 10 | 20 | 10 | |||||||||||||||||||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H1 | H1 | =MIN(IFERROR(IF(ISERROR(ABS(C1:C6-D1:D6)),"",ABS(C1:C6-D1:D6)),ABS(C1:C6-D1:D6))) |
H4 | H4 | =INDEX(A1:A6,MATCH(MIN(ABS(C1:C6-D1:D6)),ABS(C1:C6-D1:D6),0)) |
F10:F15,F1:F6 | F1 | =ABS(D1-C1) |
H10 | H10 | =INDEX(A10:A15,MATCH(MIN(ABS(C10:C15-D10:D15)),ABS(C10:C15-D10:D15),0)) |
Press CTRL+SHIFT+ENTER to enter array formulas. |