[Solved] Match data and fetch common in third cell

Discuss the spreadsheet application
Locked
yuv.370
Posts: 3
Joined: Wed Nov 06, 2024 8:24 am

[Solved] Match data and fetch common in third cell

Post by yuv.370 »

I have two row A and B both have some common number, if i type 80900 in D2 it should give me all number from b that matches from A
Attachments
demo.ods
(10.3 KiB) Downloaded 67 times
Last edited by MrProgrammer on Tue Dec 10, 2024 9:31 pm, edited 4 times in total.
Reason: Tagged ✓ [Solved] Solutions provided by Lupp; no response from yuv.370 -- MrProgrammer, forum moderator
OpenOffice 3.1 on WIN 10
User avatar
Hagar Delest
Moderator
Posts: 33629
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Math data and fetch common in third cell

Post by Hagar Delest »

Hi and welcome to the forum!

Please read the Survival Guide for the forum.
I have changed all the caps in your message. Caps are for shouting and it is a quiet place here.
If you have vision difficulties, increase the font size of the whole page because nobody will reply in all caps anyway.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Math data and fetch common in third cell

Post by Lupp »

The version you give in your signature is a very old AOO, but the example file was created with LibO 7.4.4.2. Strange!
Anyway, you surely mean the columns A and B. Both contain numbers, and the presentation of numbers is affected by formatting. Numbers used for IDs and the like should ne entered as text.
As I understand the question, you expect all the result from B where A matches what you put into D to be returned as a result in a single cell. This can only be done converting the numbers to strings and using the function TEXTJOIN() in array-mode. (Otherwise you would need to resort to user code.)
TEXTJOIN() is only available in LibO V 4.2 or higher.
If you actually run such a version you may study the attached example.
aoo112066anotherMatchRe.ods
(15.52 KiB) Downloaded 59 times
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: Math data and fetch common in third cell

Post by Alex1 »

I tried 80400 in an empty row and got "<none".
Use this in E2 instead, entered as an array formula (i.e. using Ctrl+Shift+Enter) and use the fill handle:
=TEXTJOIN(";";1;IF(A$2:A$11=D2;B$2:B$11;"")) & IF(CURRENT()="";"<none>";"")
AOO 4.1.16 & LO 25.8.3 on Windows 10
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Math data and fetch common in third cell

Post by Lupp »

Thanks for the correction @Alex1!
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
yuv.370
Posts: 3
Joined: Wed Nov 06, 2024 8:24 am

Re: Match data and fetch common in third cell

Post by yuv.370 »

Hi still getting error in formula
OpenOffice 3.1 on WIN 10
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Match data and fetch common in third cell

Post by Lupp »

1. Attach your example sheet.
2. Next to nobody else here will have an OO.o V3.1 for checks.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
yuv.370
Posts: 3
Joined: Wed Nov 06, 2024 8:24 am

Re: Match data and fetch common in third cell

Post by yuv.370 »

My OO version is 4.1.11 example attached
Attachments
aoo112066anotherMatchRe (1) (1).ods
(11.86 KiB) Downloaded 48 times
OpenOffice 3.1 on WIN 10
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Match data and fetch common in third cell

Post by Lupp »

aoo112066anotherMatchRe_Filtering.ods
(22.25 KiB) Downloaded 49 times
If you consider to shift to LibreOffice, and to use a fresh version (24.8 or higher) the filtering solution in the attached sheet will work.
To do such filtering with formulas of the "old tradition" is too complicated, and requires helper ranges.

The solution using TEXTJOIN() will only work in LibO V 4.2 or higher.
Old OO.o has no means supporting the task without resorting to user code (macros).
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: Match data and fetch common in third cell

Post by Alex1 »

yuv.370 wrote: Thu Nov 07, 2024 9:54 pm My OO version is 4.1.11 example attached
This version contains no formulas at all, so how do we know what the error is?
AOO 4.1.16 & LO 25.8.3 on Windows 10
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Match data and fetch common in third cell

Post by Lupp »

See also:
aoo112066anotherMatchRe_FilteringWithHelpers.ods
(26.06 KiB) Downloaded 69 times
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Locked