BiggusDoggus
Board Regular
- Joined
- Jul 7, 2014
- Messages
- 91
- Office Version
- 365
- Platform
- Windows
Hi all
So I have a table of data, with the columns being the months of the year. Each row has a range of data, with some or all months having values entered.
<tbody>
</tbody>
What I'm wanting to be returned in column O is the sum of the values in the first two cells of each row, from the first non-blank cell. That sum needs to include if the second cell from the first non-blank is in fact blank.
The current formula in column O is
{=IFERROR(IF(SUM(B2:INDEX(B2:M2,SMALL(IF(ISNUMBER(B2:M2),COLUMN(B2:M2)-COLUMN(B2)+1),MIN(2,COUNT(B2:M2)))))>200,"",SUM(B2:INDEX(B2:M2,SMALL(IF(ISNUMBER(B2:M2),COLUMN(B2:M2)-COLUMN(B2)+1),MIN(2,COUNT(B2:M2)))))),"")}
As you can see, row 2 works fine - the first 2 values are 1 in Feb and 5 in March, so the sum is 6.
However, row 3 is not returning what I want it to. The first non-blank cell has a value of 3, and the next cell is blank, so I want it to return 3 as the sum.
What it's doing is ignoring any subsequent blank cells after the first non blank.
I didn't write the existing formula (it's far too complex for me to have written with my current relatively limited Excel knowledge) so I don't know how to amend it.
Any help would be greatly appreciated please!
So I have a table of data, with the columns being the months of the year. Each row has a range of data, with some or all months having values entered.
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |
Sales | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Sum first 2 Months | |
1 | 5 | 6 | 8 | 6 | ||||||||||
3 | 4 | 7 | 9 | 7 |
<tbody>
</tbody>
What I'm wanting to be returned in column O is the sum of the values in the first two cells of each row, from the first non-blank cell. That sum needs to include if the second cell from the first non-blank is in fact blank.
The current formula in column O is
{=IFERROR(IF(SUM(B2:INDEX(B2:M2,SMALL(IF(ISNUMBER(B2:M2),COLUMN(B2:M2)-COLUMN(B2)+1),MIN(2,COUNT(B2:M2)))))>200,"",SUM(B2:INDEX(B2:M2,SMALL(IF(ISNUMBER(B2:M2),COLUMN(B2:M2)-COLUMN(B2)+1),MIN(2,COUNT(B2:M2)))))),"")}
As you can see, row 2 works fine - the first 2 values are 1 in Feb and 5 in March, so the sum is 6.
However, row 3 is not returning what I want it to. The first non-blank cell has a value of 3, and the next cell is blank, so I want it to return 3 as the sum.
What it's doing is ignoring any subsequent blank cells after the first non blank.
I didn't write the existing formula (it's far too complex for me to have written with my current relatively limited Excel knowledge) so I don't know how to amend it.
Any help would be greatly appreciated please!