Formula to exclude first two values

BiggusDoggus

Board Regular
Joined
Jul 7, 2014
Messages
91
Office Version
  1. 365
Platform
  1. Windows
Hi all

So I have a table of data (example below - consider the table as starting in A1):

JanFebMarAprMayJun
Z Ltd36243465
Y Ltd323123
Z Ltd4335431
A Ltd9101121

<tbody>
</tbody>

What I would like please is a formula that takes either the sum or average (doesn't matter which) for each row, but excluding the first 2 values. In essence, the first 2 numbers are during a trial period, so only want to look at the numbers after the first two months for each company.

I could do this manually, except my actual table is quite large, and is updated regularly.

Is it possible please?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Book1
ABCDEFGHI
1JanFebMarAprMayJunSum excluding first two values
2Z Ltd3624346518
3Y Ltd3231235
4Z Ltd43354318
5A Ltd91011215
Sheet1
Cell Formulas
RangeFormula
I2{=SUM(INDEX($B2:$G2,MATCH(FALSE,ISBLANK($B2:$G2),0)+2):$G2)}
Press CTRL+SHIFT+ENTER to enter array formulas.


WBD
 
Upvote 0
ABCDEFGHI
1JanFebMarAprMayJunSum excluding first two values
2Z Ltd3624346518
3Y Ltd3231235
4Z Ltd43354318
5A Ltd91011215

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
I2{=SUM(INDEX($B2:$G2,MATCH(FALSE,ISBLANK($B2:$G2),0)+2):$G2)}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



WBD

Awesome - works perfectly. Thank you!
 
Upvote 0
Hi again.

Following up from the above, what would be the formula to get the sum of the first 2 months for each client please?
 
Upvote 0
A
B
C
D
E
F
G
H
I
1
Jan​
Feb​
Mar​
Apr​
May​
Jun​
2
Z Ltd
36​
24​
3​
4​
6​
5​
60​
3
Y Ltd
32​
31​
2​
3​
0​
4
Z Ltd
43​
35​
4​
3​
1​
43​
5
A Ltd
9​
10​
1​
1​
2​
1​
19​

<tbody>
</tbody>


I2=
SUMPRODUCT((MONTH($B$1:$G$1&0)<=MONTH($C$1&0))*(B2:G2)) copy down

A
B
C
D
E
F
G
H
I
J
K
L
1
Jan​
Feb​
Mar​
Apr​
May​
Jun​
2
Z Ltd
36​
24​
3​
4​
6​
5​
Z Ltd
103​
3
Y Ltd
32​
31​
2​
3​
Y Ltd
0​
4
Z Ltd
43​
35​
4​
3​
1​
A Ltd
19​
5
A Ltd
9​
10​
1​
1​
2​
1​

<tbody>
</tbody>

L2=SUMPRODUCT((MONTH($B$1:$G$1&0)<=MONTH($C$1&0))*($B$2:$G$5)*($A$2:$A$5=$K2)) copy down

 
Last edited:
Upvote 0
Using the same logic as my original solution it would be:

Code:
{=SUM($B2:INDEX($B2:$G2,MATCH(FALSE,ISBLANK($B2:$G2),0)+1))}

WBD
 
Upvote 0
Hi!

Another way (with WBD's layout):

In I2 and copy down

=SUM(OFFSET(G2,,,,2-COUNT(B2:G2)))

In J2 and copy down

=SUM(B2:G2)-SUM(OFFSET(G2,,,,2-COUNT(B2:G2)))

Or

=SUM(B2:G2)-I2


Markmzz
 
Upvote 0
Thanks for all the help guys - went with

=SUM(IF(COLUMN(B2:G2)<=SMALL(IF(ISNUMBER(B2:G2),COLUMN(B2:G2)),2),B2:G2))

Works great.
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,314
Members
449,153
Latest member
JazzSingerNL

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top