SOLVED

Returned value in Merge Cells

Iron Contributor

Hi,

How can write a formula to get the expected result like below:

small_village_0-1673255775034.png

Thank you.

 

3 Replies
best response confirmed by littlevillage (Iron Contributor)
Solution

@littlevillage 

I would forget about the merged cells.  They will be too much trouble to maintain.

A traditional formula would be

= IF($A2<>$A1, 
     SUMIFS($B$2:$B$14, $A$2:$A$14, $A2),
  "")

and drag down.  The orange is pretty but I wouldn't use the formula, instead with 365

= LET(
    priorMVD, DROP(VSTACK("",MVD),-1),
    newMVD?,  MVD<>priorMVD,
    IF(newMVD?, SUMIFS(Unit, MVD, MVD), "")
  )

 

@littlevillage 

This is without the merged cells.

PeterBartholomew_0-1673265931622.png

 

if merge cell not easy by formula,try this online tool。

http://e.anyoupin.cn/ceshi/jstest/pull_up_demo.php?s=return_sum_group_by_in_merge


MVĐ Unit Expected result
237I51 100000 450000
237I51 200000
237I51 150000
237I52 400000 1100000
237I52 500000
237I52 100000
237I52 100000
237I53 200000 2500000
237I53 300000
237I53 400000
237I53 500000
237I53 600000
237I53 500000
1 best response

Accepted Solutions
best response confirmed by littlevillage (Iron Contributor)
Solution

@littlevillage 

I would forget about the merged cells.  They will be too much trouble to maintain.

A traditional formula would be

= IF($A2<>$A1, 
     SUMIFS($B$2:$B$14, $A$2:$A$14, $A2),
  "")

and drag down.  The orange is pretty but I wouldn't use the formula, instead with 365

= LET(
    priorMVD, DROP(VSTACK("",MVD),-1),
    newMVD?,  MVD<>priorMVD,
    IF(newMVD?, SUMIFS(Unit, MVD, MVD), "")
  )

 

View solution in original post