excel if condition or vba

J

jiyan200

i have got data in an excel sheet in 3 columns, A,B,C

What i want is B to be populated automaticaly.

I want B to be populated if the following conditions are met,
PART 1
if A = 2012 and C = 1 then B = 1
if A=2011 and C =1 then B =2
if A =2010 and C= 1 then B=3
PART 2
if A = 2011 and C = 2 then B = 1
if A=2010 and C =2 then B =2
if A =2019 and C= 2 then B=3
PART 3
if A = 2010 and C = 3 then B = 1
if A=2009 and C =3 then B =2
if A =2008 and C= 3 then B=3
PART 4
if A = 2009 and C = 4 then B = 1
if A=2008 and C =4 then B =2
if A =2007 and C= 4 then B=3

PART 5
if A = 2008 and C = 5 then B = 1
if A=2009 and C =5 then B =2
if A =2006 and C= 5 then B=3

Please help me, can all the parts be combined in one formul
 
C

Claus Busch

Hi jiyan,

Am Thu, 12 Apr 2012 14:29:50 +0000 schrieb jiyan200:
PART 1
if A = 2012 and C = 1 then B = 1
if A=2011 and C =1 then B =2
if A =2010 and C= 1 then B=3
PART 2
if A = 2011 and C = 2 then B = 1
if A=2010 and C =2 then B =2
if A =2019 and C= 2 then B=3
PART 3
if A = 2010 and C = 3 then B = 1
if A=2009 and C =3 then B =2
if A =2008 and C= 3 then B=3
PART 4
if A = 2009 and C = 4 then B = 1
if A=2008 and C =4 then B =2
if A =2007 and C= 4 then B=3

PART 5
if A = 2008 and C = 5 then B = 1
if A=2009 and C =5 then B =2
if A =2006 and C= 5 then B=3

in B1:
=IF(A1+C1=2013,1,IF(A1+C1=2012,2,3))


Regards
Claus Busch
 
P

pb

That formula will only work if the YEARS in PART 5 are changed to
2008, (2007) and 2006.
-pb
 
C

Claus Busch

Hi,

Am Thu, 12 Apr 2012 13:37:20 -0700 (PDT) schrieb pb:
That formula will only work if the YEARS in PART 5 are changed to
2008, (2007) and 2006.

I know and I think it's a typo from the OP.


Regards
Claus Busch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top