[Solved] Compare a cell with a column of cells

Discuss the spreadsheet application
Post Reply
jimglockner
Posts: 1
Joined: Wed Feb 21, 2018 9:50 pm

[Solved] Compare a cell with a column of cells

Post by jimglockner »

I would like to compare a cell (A1) with four other cells in a column and return a string ("Not found") if no match is detected. What formula can I use to accomplish this task?

Your help is much appreciated.
Last edited by jimglockner on Thu Feb 22, 2018 7:54 pm, edited 2 times in total.
Openoffice 4.1.2
Windows 10
FJCC
Moderator
Posts: 9274
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Compare a cell with a column of cells

Post by FJCC »

Let's say you want to search for the value of A1 in B1:B4. You can return either Found or Not Found with

Code: Select all

=IF(COUNTIF(B1:B4;A1) > 0;"Found"; "Not Found")
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.
Post Reply