Thread: If with or
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default If with or

Hi,

Am Tue, 29 Aug 2017 08:47:35 +0100 schrieb jnasser:

for example I have the following values

11223300
44556600
66778800
99999900
77777700

I want to say if the first 6 digits in ( A1) equals to 112233 , 445566,
667788 then give the value of A , and if the first 6 digits in (A1)
equals to 999999 then give the value of B, if neither then give the
value of C


try:
=IF(OR(--LEFT(A1,6)={112233,445566,667788}),A1,IF(--LEFT(A1,6)=999999,B1,C1))
or:
=IF(COUNT(FIND({112233,445566,667788},A1))0,A1,IF (--(LEFT(A1,6))=999999,B1,C1))


Regards
Claus B.
--
Windows10
Office 2016