Need help to return last value in row and also a value in column specified number of columns to left

jjs98

New Member
Joined
Feb 15, 2013
Messages
3
Hi there,

Many thanks in advance for any help/solutions on this (I'm sure) very simple problem from a newbie.

I have a row of numerical data which is updated daily. On a different tab in the same sheet, I want to create a formula with divides the last value in the row by a value in the same row that is a specified number of columns behind the last one.

An example:

1/1/131/2/131/3/131/4/131/5/131/8/131/9/131/10/13
1011912810910

<tbody>
</tbody>


I want a formula that takes the last value ("10" on 1/10/13) and divides it by the corresponding value 5 (busines) days earlier (which would be 1/3/13 or "9"), which is easy enough of course. What I want to know is how to get the formula to update automatically, as I enter new values for each day.

I have figured out how to return the last value in a row using =LOOKUP(9.9999999999999+307, row#:row#), which I could theoretically use to get the updated last number in the row. The question is how to get the trailing number.

All the bets and thanks for taking the time!

Jim
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
try
=LOOKUP(9.9999999999999+307,2:2)/INDEX(2:2,MATCH(9.9999999999999+307,2:2,1)-5)

Thank you so much for this, it worked wonderfully! Just out of curiosity (and so that I understand this in the future) the "1" in the last entry in the MATCH piece, what does that do?

Again, thanks so much! Hopefully I can return the favor some day once I get better at this...

Jim
 
Upvote 0
MATCH(9.9999999999999+307,2:2,1) the 1 means
If match_type is 1, MATCH finds the largest value that is less than or equal to lookup_value. Lookup_array must be placed in ascending order: but a quirk of that is if it isn't in any particular order it matches 9.9999999999999+307 with the last value
 
Upvote 0
MATCH(9.9999999999999+307,2:2,1) the 1 means
If match_type is 1, MATCH finds the largest value that is less than or equal to lookup_value. Lookup_array must be placed in ascending order: but a quirk of that is if it isn't in any particular order it matches 9.9999999999999+307 with the last value

Interesting.... This is just a quirk of the way the command functions? I think that is the type of thing that makes these forums so useful--there's no way I would have been able to guess that that quirk existed!

Actually in applying this I ran up against another problem that is confusing me to no end.

I have 6 or so rows of data that update daily like described at first. I have then skipped a row and put two more rows of data for benchmarking. It looks something like this:

Day 1Day 2Day 3Day 4Day 5Day 6Day 7Day 8Day 9
Data string 1#######
Data string 2#######
Data string 3#######
Data string 4#######
Data string 5#######
Data string 6#######
Benchmark 1#####
Benchmark 2#######

<tbody>
</tbody>

So the formula with INDEX and MATCH working perfectly to get the last value entered for the Data strings and to get the change versus a trailing number (5 days I used in my example). The problem is that as I pulled the formula down to the two benchmarks, I got an incorrect result for the first and a #N/A for the second. I could see perhaps why the first was screwed up b/c of the #s not going all the way back to the start (leftmost column), but the 2nd Benchmark is very peculiar indeed. The numbers are large (thousands) but i can't imagine that would have made a difference.

To backtest and see if I could figure it out myself I did the simple LOOKUP(9.9999999999999+307, Row#:Row#) to both benchmarks. The Benchmark 1 returns a value in the middle of the data string (not the rightmost entry), which explains the calculation error but not why it is doing it. The second gives you a #N/A. The calculation error, when you show the steps in the calc, happens right at the start when LOOKUP(317 attempts to apply to the Row#:Row#.

Confused and thanks for any help again!
Jim
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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