Sum of last 3 entered columns formula?

krispartsbadger

New Member
Joined
May 13, 2022
Messages
23
Office Version
  1. 365
I track my month to month financials and use =LOOKUP(99^99,A3:L3) in a column to keep track of the month to date total. What would be a formula to calculate the sum of the 3 previous months?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I track my month to month financials and use =LOOKUP(99^99,A3:L3) in a column to keep track of the month to date total. What would be a formula to calculate the sum of the 3 previous months?

I have shown you how to do it for the last 3 filled cells down a column HERE

For last 3 filled cells across a row you can use

Excel Formula:
=IFERROR(SUM(OFFSET(A2,0,LARGE(IF(B2:M2<>"",COLUMN(B2:M2))-1,3),1,(13-LARGE(IF(B2:M2<>"",COLUMN(B2:M2))-1,3)))),"-")

Few things worth mentioning.
  1. This formula caters to blank cells in between if there are any.
  2. This is for 12 cells. Amend the formula accordingly.
  3. If there are less than 3 values, then it doesn't error out.

1661200149386.png
 
Upvote 0
What am I doing wrong? I've copied what your formula, but I get a "-" in A4
 

Attachments

  • Screenshot 2022-08-22 162013.png
    Screenshot 2022-08-22 162013.png
    24.4 KB · Views: 5
Upvote 0
It works for me.

1661203500578.png


Try the formula without the IFERROR. See what error do you get?

Excel Formula:
=SUM(OFFSET(A2,0,LARGE(IF(B2:M2<>"",COLUMN(B2:M2))-1,3),1,(13-LARGE(IF(B2:M2<>"",COLUMN(B2:M2))-1,3))))
 
Upvote 0

Forum statistics

Threads
1,215,262
Messages
6,123,939
Members
449,134
Latest member
NickWBA

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