Forum Discussion
richzip1
Jul 03, 2021Copper Contributor
Sum of variable number of rows
Hello, I would like to find a formula that will take the total of a column -- but the number of rows in that column will vary. The attachment hopefully helps to visualize how the totals should be gr...
- Jul 03, 2021
A formula solution that assumes data are exactly as in your sample
in F2 and copy right then down:
=IF( AND(ISNUMBER($B2),ISNUMBER($C2)), D2, IF(ISNUMBER($B2), SUM(OFFSET($D2,,COLUMNS($F:F)-1,MATCH(INT($B2), INT($C2:$C15),0))), "") )and validate it with CTRL+SHIFT+ENTER (or its equiv on Mac) if you don't run Excel 365/Web
Corresponding sample attached
Lorenzo
Jul 03, 2021Silver Contributor
Kind reminder 🙂from Welcome to your Excel discussion space!:
- Device and OS platform, e.g., PC/Windows 10 or Mac/macOS Big Sur 11.2.1
- Excel product name and version number
(re. your report: the kind of setup that necessarily causes problems when calcs are required)
A Power Query solution attached