Learn how to merge cells in Google Sheets, when to use them and when to avoid them [and] finding merged cells in your Google Sheet using Apps Script
Some very useful guidance from Ben Collins on merged cells within Google Sheets. As well as how to merge/unmerge cells Ben also highlights some of the pitfalls when merging cells. The post also includes a very useful snippet for detecting merged cells using .getMergedRanges()
.
Source: How To Merge Cells In Google Sheets And When To Be Careful

Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.