0

I have an array setup in D13:D19 where values are entered by the user. I'm modifying the formulas in my sheet to not be dependant on all cells being input.

In the column adjacent to the array I have it showing the change from the previous cell like so:

=IF([@[Weight (lbs)]]="","",[@[Weight (lbs)]]-D17) 

Where D17 is the cell above the current row [row 18].

I need to redo this so that it looks at the adjacent cell for an integer, if an integer exists then it checks the array above it for the last value and uses that value in the formula. If no integer exists the cell remains blank.

Example:

Cell D15 = 155 
Cell D16 = 155 
Cell D17 = BLANK 
Cell D18 = 145

In E18, the formula will need to look at D18 to see if there is an integer, if yes then it will then look for the last filled cell in the array which in this example is D16. Then it will subtract the last entered cell from D18 [D18-D16].

2
  • The last filled cell above D18? What if D18 is not an integer, and could it be a decimal? Commented Feb 28, 2017 at 22:29
  • Yes. Last filled cell that occurs above D18, which in the example is D16 due to D17 being skipped. Any number in the array D13:D19 could be a decimal, you're correct. Commented Mar 1, 2017 at 7:27

1 Answer 1

1

Put this in place of D17 in your formula:

INDEX(D:D,MATCH(1E+99,D1:INDEX(D:D,ROW()-1)))

It will return the value of the last cell with a number above the current row.

Sign up to request clarification or add additional context in comments.

10 Comments

Worked perfectly. Thanks again!
One question, am I able to limit the index to the D13:D19 ranges instead of the full column?
Yes, Just change the both D:D to your range and the D1 to D13
Try this new formula, you may need to put the formula in manually: =INDEX($D$13:$D$19,MATCH(1E+99,$D$13:INDEX(D$1:$D$19,ROW()-1))) because the comments sometimes adds unprintable characters.
It is working for me, without problem. So from here I do not know what to tell you.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.