Hey
I managed to track down a formula that returns the row/ column value of the last occurrence of a value in an array. It looks something like this:
=SUMPRODUCT(MAX(($A$1:$W$1="X")*COLUMN($A$1:$W$1)))
It works quite well, but I honestly don't know how it works
This is how I understand it: $A$1:$W$1="X" returns an array of 1's and 0's, so MAX(($A$1:$W$1="X")*COLUMN($A$1:$W$1)) will return the maximum all the 1's and 0's multiplied by their column values, ergo the last one. But if you just enter that function (without the sumproduct that is), the answer is 0. If you add the sumproduct function, you get the correct answer. I've uploaded an example.
Can someone please help me understand what's going on? I get the feeling that if you understand how this function works, you'll be able to do a lot more in Excel
Thanks
Veldrin
I managed to track down a formula that returns the row/ column value of the last occurrence of a value in an array. It looks something like this:
=SUMPRODUCT(MAX(($A$1:$W$1="X")*COLUMN($A$1:$W$1)))
It works quite well, but I honestly don't know how it works
This is how I understand it: $A$1:$W$1="X" returns an array of 1's and 0's, so MAX(($A$1:$W$1="X")*COLUMN($A$1:$W$1)) will return the maximum all the 1's and 0's multiplied by their column values, ergo the last one. But if you just enter that function (without the sumproduct that is), the answer is 0. If you add the sumproduct function, you get the correct answer. I've uploaded an example.
Can someone please help me understand what's going on? I get the feeling that if you understand how this function works, you'll be able to do a lot more in Excel
Thanks
Veldrin