The worksheet object has a method called
getMergeCells()
that will return an array of all the merged cell blocks in that worksheet.... you can identify if a cell is part of a merge group by calling the cell objects isInRange()
method against each of those merged cell entries in turn until a match is found, or you reach the end of the array without a valid match