LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default how to get IF(OR) formula to recognize multiple cells

I copied and pasted your formula then changed it to reflect 2 columns ranging
from P1:I27 but get #NAME? in the destination cell. If it matters iI am
using excell 2003.
--
rwfster


"GSnyder" wrote:

I'd try to tackle this by using a range of values and a VLOOKUP instead of
hard coding each value. This will give you lots of flexibility for adding
and removing any of the constraints.

In this solution, I'm assuming that you mean if A1 OR B1 OR C1 OR D1 match
the criteria, then you want an 'X' to show up in E1.

Create a 2-column table in, say, H1:I50 (or however many constraints you
have) that has each of your constraints with a 1 next to it. It looks like
this:

String Value
x 1
a1 1
a2 1
a3 1
et. cetera

This table could even be on a different sheet if you want to tuckit
somewhere away.

Then, assuming your strings are in A1:D1 that you want to check, place this
formula in E1:

=IF(IFERROR(VLOOKUP(A1,$H$2:$I$11,2,0),0)+IFERROR( VLOOKUP(B1,$H$2:$I$11,2,0),0)+IFERROR(VLOOKUP(C1,$ H$2:$I$11,2,0),0)+IFERROR(VLOOKUP(D1,$H$2:$I$11,2, 0),0)0,"X","")

This will look up each of the cells A1:D1 in the table and if it's there, it
will return a 1. If not, it errors out and returns a 0. Then it adds them
all up and if at least one of them hit, you get your X!

Hopefully, you're using Excel 2007 so the IFERROR function works, otherwise,
this thing gets ugly so you might need to split it up.

I like this better because it's flexible. You can add as many constraints
as you want in the list.

Happy calculating!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cells don't recognize formula Chris D Excel Worksheet Functions 0 May 19th 08 08:35 PM
How do I recognize duplicate cells in multiple columns? cp mccall Excel Discussion (Misc queries) 1 August 22nd 06 04:32 AM
How do I format a formula to recognize multiple comparison factors CandaceES Excel Worksheet Functions 0 April 20th 06 08:32 PM
How to format cells to recognize numbers like 1.1.1? GStrawley Excel Discussion (Misc queries) 2 January 27th 06 06:54 PM
How to make a cell recognize multiple text strings? Tourcat Excel Worksheet Functions 1 February 8th 05 08:29 PM


All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"