You need to populate the cells in your worksheet and apply the styles you want the cells to have. I've found this quite annoying with MS Excel as LibraOffice handles sparse sheets perfectly.
If you look at the example below, you will notice that "" is being pushed into the empty cells that will be merged, and the style is applied to those cells as well.
#```ruby
wb.add_worksheet(:name => 'Merging Cells') do |sheet|
# cell level style overides when adding cells
sheet.add_row ["col 1", "col 2", "col 3", "col 4"], :sz => 16
sheet.add_row [1, 2, 3, "=SUM(A2:C2)"]
sheet.add_row [2, 3, 4, "=SUM(A3:C3)"]
sheet.add_row ["total", "", "", "=SUM(D2:D3)"]
sheet.merge_cells("A4:C4")
sheet["A1:D1"].each { |c| c.color = "FF0000"}
sheet["A1:D4"].each { |c| c.style = Axlsx::STYLE_THIN_BORDER }
end
#```