[Solved] Determine numbers common to two cells

Discuss the spreadsheet application
Locked
traggik
Posts: 4
Joined: Mon Jan 20, 2025 12:43 am

[Solved] Determine numbers common to two cells

Post by traggik »

Hi there, I am a newbie here. I am trying to get a function command for the following. This is just a short example. Lets say you have 1 set of numbers (6,12,33) in one cell, and (2,12,54) in another cell. How do i find the common numbers in the 2 cells, I know it is 12. But what function formula do i use. This is just a short example, but for the real thing would be numerous numbers with commas spacing them. Thanks, any information will be greatly appreciated.

 Edit: Changed subject, was Help with function formula? 
Make your post understandable by others 
-- MrProgrammer, forum moderator 
Last edited by robleyd on Tue Jan 21, 2025 3:37 pm, edited 3 times in total.
Reason: Add green tick
Openoffice 4.1.15, win 10
traggik
Posts: 4
Joined: Mon Jan 20, 2025 12:43 am

Re: Determine numbers common to two cells

Post by traggik »

which command do i use to determine numbers common to two cells. For example, 1 cel has a set of numbers (1,3,4,5,6), and the other cell has a set of numbers (1, 2, 10,11,12) The repeating or common number is (1). Which command do i use to determine this?
Openoffice 4.1.15, win 10
crusader
Volunteer
Posts: 537
Joined: Sun Jan 20, 2008 5:06 am

Re: Determine numbers common to two cells

Post by crusader »

Can each cell be populated by one number only, creating multiple columns as shown in the attachment? If that is possible/acceptable, conditional formatting can provide excellent visual answers.
Attachments
Numbers Common to Multiple Columns.ods
(10.3 KiB) Downloaded 75 times
LibreOffice 26.2.x on Linux Mint Cinnamon 22.3
In a world without walls, who needs Window$
A candle loses nothing by lighting another candle
traggik
Posts: 4
Joined: Mon Jan 20, 2025 12:43 am

Re: Determine numbers common to two cells

Post by traggik »

Ok, but which formula do I use to find the repeating number? So that i can show that in a different cell?
Openoffice 4.1.15, win 10
FJCC
Moderator
Posts: 9624
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Determine numbers common to two cells

Post by FJCC »

The attached file shows how to get what you want using some helper columns in crusader's file. I can't think of a simple way to do this in a single cell.
Attachments
Numbers Common to Multiple Columns_FJCC.ods
(11.23 KiB) Downloaded 126 times
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
crusader
Volunteer
Posts: 537
Joined: Sun Jan 20, 2008 5:06 am

Re: Determine numbers common to two cells

Post by crusader »

traggik wrote: Mon Jan 20, 2025 3:16 am Ok, but which formula do I use to find the repeating number? So that i can show that in a different cell?
In the example I attached, I used "conditional formatting," as opposed to a formula.
Steps: highlight the relevant cells, then on the menu, click on Format -> Conditional -> Condition -> More Rules -> enter your choices.
The result will highlight numbers common in both columns (or all columns, depending on your range) - as shown in the attachment.

Edit: my apologies, I just realized you are using Openoffice 4.1.15; the steps I outlined above are for LibreOffice 24.8. The essence is the same in all spreadsheets; individual steps may differ (think of this as an opportunity to upgrade to LibreOffice). :D
LibreOffice 26.2.x on Linux Mint Cinnamon 22.3
In a world without walls, who needs Window$
A candle loses nothing by lighting another candle
crusader
Volunteer
Posts: 537
Joined: Sun Jan 20, 2008 5:06 am

Re: Determine numbers common to two cells

Post by crusader »

FJCC wrote: Mon Jan 20, 2025 4:05 am The attached file shows how to get what you want using some helper columns in crusader's file. I can't think of a simple way to do this in a single cell.
FJCC's spreadsheet should do it - and it has formulas that will help you get what you want!
LibreOffice 26.2.x on Linux Mint Cinnamon 22.3
In a world without walls, who needs Window$
A candle loses nothing by lighting another candle
User avatar
LastUnicorn
Posts: 812
Joined: Sat Mar 29, 2008 2:41 am
Location: Scotland

Re: Determine numbers common to two cells

Post by LastUnicorn »

Making the switch from OpenOffice to LibreOffice is good advice. There are several good reasons for making the switch, some of which are mentioned here: [Tutorial] Considering a Switch from OpenOffice to LibreOffice? Some Useful Information
LibreOffice 25.8.4.2 (x64) installed to Windows 11 Pro. 25H2
Apache OpenOffice Portable 4.1.16 [Portable Apps]
For Java I use Adoptium Temurin JRE LTS Releases.
traggik
Posts: 4
Joined: Mon Jan 20, 2025 12:43 am

Re: Determine numbers common to two cells

Post by traggik »

ok great thank you so much. this really helps out alotl. thank you again for your time and effort, greatly appreciate it.
Openoffice 4.1.15, win 10
User avatar
Hagar Delest
Moderator
Posts: 33632
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Determine numbers common to two cells

Post by Hagar Delest »

Thanks to report if you still need help or if you're good. In latter case, please add [Solved] at the beginning of the title in your first post (top of the topic) with the 🖉 button if your issue has been fixed.
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: Determine numbers common to two cells

Post by Lupp »

In some very special cases something you want to achieve without the need of interactive usage of the UI, simply has no solution or only extremely complicated solutions based on standard fuctions.
In such cases the creation of an UDF may be next to indispensable.

For the given case the attached example file contains such a solution: Also: Don't use the comma as the list separator where the elements are (can be) numeric strings.
For good reasons AOO Calc uses the semicolon as the argument separator in function calls.
The majority of locales uses the comma as the decimal separator.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Locked