Math on last non zero cell in a row

pfaustino

New Member
Joined
Sep 18, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I have a spreadsheet with columns that represent months, and rows that represent numbers. I want to have one final cell in the row that represents the value of the first cell in the row minus the last non zero entry in the row. Would a formula be best? I’m an excel novice and am running into circular math errors. Thanks for any guidance you can provide.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

maabadi

Well-known Member
Joined
Oct 22, 2012
Messages
2,681
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Welcome to MrExcel Message Board.
Try this:
Book1
ABCDE
1Jan
24540
312
45
518
64
715
822
912
1027
1119
120
135
140
150
160
17
Sheet1
Cell Formulas
RangeFormula
C2C2=A2-LOOKUP(2,1/($A$2:$A$16 <> 0 ),$A$2:$A$16)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,574
Messages
5,770,928
Members
425,652
Latest member
Pemby

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
Top