Nested 4 IFs

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,226
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
4 columns (AR, AS, BD & BE) contains either 0 or 1. Output (column CA) is required based on combination/(s).
If
AR35=1 AS35=1 BD35=1 BE35=0 Then CA35 should give 1
AR35=0 AS35=1 BD35=1 BE35=0 Then CA35 should give 2
AR35=0 AS35=1 BD35=1 BE35=0 Then CA35 should give 3
AR35=1 AS35=1 BD35=1 BE35=1 Then CA35 should give 4

What formula needs to be filled in CA35?
Thanx in advance.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
4 columns (AR, AS, BD & BE) contains either 0 or 1. Output (column CA) is required based on combination/(s).
If
AR35=1 AS35=1 BD35=1 BE35=0 Then CA35 should give 1
AR35=0 AS35=1 BD35=1 BE35=0 Then CA35 should give 2
AR35=0 AS35=1 BD35=1 BE35=0 Then CA35 should give 3
AR35=1 AS35=1 BD35=1 BE35=1 Then CA35 should give 4

What formula needs to be filled in CA35?
Thanx in advance.

=MATCH(AR35&AS35&BD35&BE35),{"1110","0110","0110","1111"},0)

The red entry and the entry before are the same!... Adjust to suit.
 
Upvote 0
=MATCH(AR35&AS35&BD35&BE35),{"1110","0110","0110","1111"},0)

The red entry and the entry before are the same!... Adjust to suit.

2nd line should read as: AR35=0 As35=1 BD35=1 BE35=1 Then CA35 should give 2
I changed to 0111 instead of 0110 in Aladin's formula but the excel is not accepting the formula. Formula gets highlighted at BE35.
 
Upvote 0
How to get 1 or 2 or 3 or 4 in CA35? based on above 4 criterias.
 
Upvote 0
Try this adjustment to Aladin's previous formula.

=MATCH(AR35&AS35&BD35&BE35,{"1110","0111","0110","1111"},0)
 
Upvote 0
Adjustments to Aladin Formula..

=MATCH((AR35&AS35&BD35&BE35)*1,{1110,111,110,1111},0)
 
Upvote 0
=MATCH(AR35&AS35&BD35&BE35,{"1110","0111","0110","1111"},0)[/QUOTE]
This WORKS now.
 
Upvote 0
Another solution:
=IF((AR35&AS35&BD35&BE35)={"1110"},1,IF((AR35&AS35&BD35&BE35)={"0110"},2,IF((AR35&AS35&BD35&BE35)={"0111"},3,IF((AR35&AS35&BD35&BE35)={"1111"},4,"N/A"))))

Or if you want a shorter foruma, the constraint is that there should always be a one of the 4 values in the cells:
=IF(AR35=0;IF(BE35=0;2;3);IF(AR35=1;IF(BE35=1;4;);1))
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top