Populate Last Value in Column and Ignore Errors

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
922
Office Version
  1. 365
Hi,

I have the following table:

Book1
CDEF
7Table 1Table 2
8SalesAcc SalesAcc Sales
9100100100
10#NUM!#NUM!100
11100#NUM!200
12#NUM!#NUM!200
13#NUM!#NUM!200
14#NUM!#NUM!200
15100#NUM!300
16100#NUM!400
17#NUM!#NUM!400
18#NUM!#NUM!400
19#NUM!#NUM!400
Sheet1
Cell Formulas
RangeFormula
D9D9=C9
D10:D19D10=D9+C10


I have my data in Table 1. In column D, I am calculating the accumulated sales. However, since some of the cells in column C has error value, the formula does seems to be able to return the correct accumulated value. If column C has error values, the accumulated total in column D should return the last accumulated value in column D. The correct results is in Table 2.

Is there a way to modify the current formula to achieve this ? Appreciate all the help.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How about
Excel Formula:
=SUM(IFERROR(C$9:C9,0))
 
Upvote 0
Solution
VBA Code:
=SUMIF(C$9:C9,">0")
1643547417042.png
 
Upvote 0
Hi Fluff, kvsrinivasamurthy and shaowu459,

Thank you for the solution. It worked and appreciate your patience and valuable time. Have a great day ahead.?
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,178
Members
449,071
Latest member
cdnMech

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