[Solved] Pulling the last non zero from a row

Discuss the spreadsheet application
Post Reply
Raistlin212
Posts: 3
Joined: Tue Sep 18, 2018 1:53 am

[Solved] Pulling the last non zero from a row

Post by Raistlin212 »

I've seen a few questions of this type but I can't figure out how to accomplish this seemingly easy task. C68 to AG68 populate with numbers each day. The rest of the yet unused columns are a zero. I need AH68 to be the last non-zero number. So for example, at the of the 15th there's 15 numbers around 100,000 each then 15 zeros. I need that 15th number to repeat at the end of the line. I've tried lookups and indexes but I can't seem to get it to work in Calc.
Last edited by Raistlin212 on Wed Sep 19, 2018 1:32 am, edited 1 time in total.
OpenOffice 4.1.5 on Windows Embedded
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Pulling the last non zero from a row

Post by Zizi64 »

Try to use the
- MATCH(): this function can get the number of the first zero. (It will work as you expected is the data series not contain zero values, zeros are only on the end of the series.)
- OFFSET(): this function can get a value from a relative position based on the start cell.

Here is a sample file (there are column based data series in my file):
MATCH_OFFSET.ods
(11.6 KiB) Downloaded 71 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Bald Eagle
Posts: 68
Joined: Wed Apr 19, 2017 9:22 pm

Re: Pulling the last non zero from a row

Post by Bald Eagle »

This is usually WAY easier to do with a helper row/column.

See the attached spreadsheet for an example.
Attachments
LastNonZero.ods
(11.22 KiB) Downloaded 62 times
OpenOffice 4.1.1 on Windows 7
Post Reply