soumya ranjan panda
soumya ranjan panda

Reputation: 25

How to fill excel column using if condition

i have 3 columns in excel sheet.Let it be A B C. In A column it contain some values Y,Y,Y,N,N,Y..... similarly in B column it has values like Y,N,Y,Y.....

My aim is to fill column C using condition If A Contains Y and B contains Y then C will be S1,S2. If A Contains Y and B Contains N then C will be S1. If A contains N and B contains Y then c will be s2.

Upvotes: 1

Views: 1926

Answers (2)

Prashanth Benny
Prashanth Benny

Reputation: 1609

copy this function to C1 and drag the bottom right corner of that tab through the C column till there are entries in A and B!

=IF(AND(A1="y" , B1="y"),S1 & " " &S2,IF(AND(A1="y" , B1="n"),S1,IF(AND(A1="n" , B1="y"),S2 )

change the parameters as required...

hope this helped you!

Upvotes: 1

Mrig
Mrig

Reputation: 11702

I guess this is what you are looking for:

=IF(A1="Y",IF(B1="Y","S1,S2","S1"),IF(B1="Y","S2",""))

enter image description here

Upvotes: 2

Related Questions