Hello,
I'm hoping this isn't too complicated but here's what I'm trying to accomplish with no avail.
I have numbers in rows B, C ,D and E. I am trying to write a macro in excel that will populate column F based on the following:
2nd lowest number if there are 4 non-zero numbers, the middle number if 3 non-zero numbers, the lowest of 2 numbers if there are 2 non-zero numbers, 1 of 1 if there is only one non-zero number.
If it's too complicated to consider non-zero numbers, I could always replace 0s with a blank cell beforehand to make that easier.
The one caveat is duplicate numbers would need to count towards the formula i.e. 5/5/5/4 would result in a value of 5, not 4.
5
5
5 - 2nd lowest of 4
4
e.g.
I'm hoping this isn't too complicated but here's what I'm trying to accomplish with no avail.
I have numbers in rows B, C ,D and E. I am trying to write a macro in excel that will populate column F based on the following:
2nd lowest number if there are 4 non-zero numbers, the middle number if 3 non-zero numbers, the lowest of 2 numbers if there are 2 non-zero numbers, 1 of 1 if there is only one non-zero number.
If it's too complicated to consider non-zero numbers, I could always replace 0s with a blank cell beforehand to make that easier.
The one caveat is duplicate numbers would need to count towards the formula i.e. 5/5/5/4 would result in a value of 5, not 4.
5
5
5 - 2nd lowest of 4
4
e.g.
A | B | C | D | E | F - result |
Jim | 5 | 5 | 5 | 4 | 5 |
Paige | 1 | 3 | 2 | 0 | 2 |
Joseph | 0 | 0 | 1 | 2 | 1 |
Carl | 1 | 1 | 2 | 0 | 1 |
Kim | 4 | 3 | 2 | 1 | 2 |
Joe | 0 | 1 | 1 | 1 | 1 |
Chase | 4 | 4 | 0 | 0 | 4 |
Paul | 0 | 3 | 0 | 0 | 3 |