[Solved] Get previous value for the category

Discuss the spreadsheet application
Post Reply
PeterV
Posts: 2
Joined: Sun Dec 24, 2023 7:48 pm

[Solved] Get previous value for the category

Post by PeterV »

I'm searching the internet and Bing AI to find an answer to following question.
What is the formula to find the value of a cel in a column of the last previous row that has a corresponding value in a another column, giving the fact there's no sorting in any columns. See attachment for details. Maybe it's a trival thing, but since I can't find the solution, I will be glad someone can give an answer.
Puzzle calc openoffice.ods
(13.34 KiB) Downloaded 181 times
 Edit: Changed subject, was Formula for info in previous rows in Calc 
Make your post understandable by others 
-- MrProgrammer, forum moderator 
Last edited by Hagar Delest on Mon Dec 25, 2023 8:09 pm, edited 2 times in total.
Reason: tagged solved.
Version: OpenOffice 4.1.15
Operating system: Windows 10 Home 64-Bit
Laptop RAM: 8,00GB Single-Channel DDR4
User avatar
MrProgrammer
Moderator
Posts: 4909
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Formula for info in previous rows in Calc

Post by MrProgrammer »

Hi, and welcome to the forum.
PeterV wrote: Sun Dec 24, 2023 9:01 pmBing AI
Ha! But thank you for trying. It's more than most visitors here do. We do have topics in the forum about this subject, though I appreciate they may be difficult to locate.

PeterV wrote: Sun Dec 24, 2023 9:01 pm What is the formula to find the value of a cell in a column of the last previous row that has a corresponding value in a another column?
Formulas in yellow cells must be entered as Array formulas. Press ⇪⌘Enter (Shift+Command+Enter) on a Mac or Ctrl+Shift+Enter on other platforms; if you press Enter by mistake, use Edit → Delete Contents → Formulas, then try again. Do not attempt to drag an array formula to other cells using the Fill Handle. You can fill the formula down by double-clicking the Fill Handle, or you can use Copy and Paste. D2 is the constant 0 because that row never has a previous value.
202312241310.ods
(19.99 KiB) Downloaded 197 times
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Get previous value for the category

Post by Villeroy »

Open the attached database document.
Open the form therein.
When you navigate to a record having a precedent, the precedent's details are shown in the white boxes.
Works indepentently from any sort order as you can see when you sort ascedingly or descendingly by figure or date.
Attachments
t111011.odb
(14 KiB) Downloaded 183 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
PeterV
Posts: 2
Joined: Sun Dec 24, 2023 7:48 pm

Solved: Get previous value for the category

Post by PeterV »

Thank both for the quick answer.
Version: OpenOffice 4.1.15
Operating system: Windows 10 Home 64-Bit
Laptop RAM: 8,00GB Single-Channel DDR4
Post Reply