This solution uses three helper columns, which may be hidden for aesthetic purposes. The first helper column gives the number of columns that needs to be added to the address of the first cell in 'Last Group' for that row. The array entered formula* that does this is:
*Array entered formulas are confirmed by pressing
CTRL+SHIFT+ENTER to activate the array,
not just ENTER. You will know the array is active when you see curly braces
{ } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
The second helper column uses the following formula to find the first cell of the range whose values are to be compared:
The third helper column uses the following formula to find the last cell of the range whose values are to be compared:
Column N is then populated with the formula:
Let me know if you have any questions.
Bookmarks