ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF..., then.... (https://www.excelbanter.com/excel-discussion-misc-queries/76874-if-then.html)

JcR

IF..., then....
 
If value in cell a1 = value in cell a2 or a3 or a4, then display the value in
cell b2 in cell c2
If value in cell a1 = value in cell a5 or a6 or a7, then display the value
in cell b5 in cell c2
If value in cell a1 = value in cell a8 or a9, then display the
value in cell b8 in cell c2


Paul Lautman

IF..., then....
 
JcR wrote:

in C2:
=IF(OR(A1=A2,A1=A3,A1=A4),B2,IF(OR(A1=A5,A1=A6,A1= A7),B5,IF(OR(A1=A8,A1=A9),B8,"")))



JcR

IF..., then....
 
Thanks Paul,

This works. Is there any way to shorten the equation ?

I have about 1000 values in cells a2 through a1000.

I only have about 10 values in the b column.

In other words, a2 through a100 will = "a" in column b
and
a101 through a200 will = "b" in column b
and
a201 through a300 will = "c" in column b

etc....

Is there any way to

"Paul Lautman" wrote:

JcR wrote:

in C2:
=IF(OR(A1=A2,A1=A3,A1=A4),B2,IF(OR(A1=A5,A1=A6,A1= A7),B5,IF(OR(A1=A8,A1=A9),B8,"")))




Bob Phillips

IF..., then....
 
IF(COUNTIF(A2:A100,A1)0,B2,IF(COUNTIF(A101:A200,A 1)0,B5,IF(COUNTIF(A201:A3
00,A1)0,B8,"")))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"JcR" wrote in message
...
Thanks Paul,

This works. Is there any way to shorten the equation ?

I have about 1000 values in cells a2 through a1000.

I only have about 10 values in the b column.

In other words, a2 through a100 will = "a" in column b
and
a101 through a200 will = "b" in column b
and
a201 through a300 will = "c" in column b

etc....

Is there any way to

"Paul Lautman" wrote:

JcR wrote:

in C2:

=IF(OR(A1=A2,A1=A3,A1=A4),B2,IF(OR(A1=A5,A1=A6,A1= A7),B5,IF(OR(A1=A8,A1=A9),
B8,"")))







All times are GMT +1. The time now is 02:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com