Finding previous number to sum

GBCTeacher

New Member
Joined
Apr 16, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I am looking for a function that will find the last number in a row, then add it to another cell. The formula in K13 is =IF(ISBLANK(K12),NA(),IF(ISBLANK(J12),K12,J13+K12)) which works if there are no gaps in the data. In this example there is a gap, and I need the formula to search the row and find the last number to the left. In this case the last number is in H12. In my current formula I've tried various functions to replace J13, such as Lookup and Index, but I can't seem to get these to work. The #N/A is there to make the line chart not drop to 0, so I can't remove that. Sorry about the screenshot, but I tried to add the minisheet and my company blocks addins. Anything to point me in the right direction would be appreciated.

1713278701009.png
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi & welcome to MrExcel.
Are you trying to find the last value in row 12 or 13?
 
Upvote 0
Hi & welcome to MrExcel.
Are you trying to find the last value in row 12 or 13?
Row 13. I need the last number to the left. I need it to skip the #N/A's and look at the next value to the left.
 
Upvote 0
Ok, how about
Excel Formula:
=IF(ISBLANK(K12),NA(),IF(ISBLANK(J12),K12,LOOKUP(10^9,$E13:J13)+K12))
 
Upvote 0
Ok, how about
Excel Formula:
=IF(ISBLANK(K12),NA(),IF(ISBLANK(J12),K12,LOOKUP(10^9,$E13:J13)+K12))
Ok, how about
Excel Formula:
=IF(ISBLANK(K12),NA(),IF(ISBLANK(J12),K12,LOOKUP(10^9,$E13:J13)+K12))
That didn't work. I still get the answer from K12 in cell K13, and it isn't adding in the 1,094,298 from cell H13..
 
Upvote 0
That's because J12 is empty. So what exactly are you trying to do?
 
Upvote 0
That's because J12 is empty. So what exactly are you trying to do?
I am trying to accomplish two things here. One is to get the line chart to start at its value and stop without going back to zero. The second thing is to get the cumulative value to compute even when there are gaps in the data.
 
Upvote 0
That doesn't really tell me much, but maybe
Excel Formula:
=IF(ISBLANK(K12),NA(),IFNA(LOOKUP(10^9,$E13:J13),0)+K12)
 
Upvote 1
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,263
Members
452,627
Latest member
KitkatToby

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