CF in a cell with 6 conditions

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,226
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
I want to formulate 6 CFs in a cell B1 to generate either of the value 1,2,3,4,5,6.

6 CFs are to be formulated to generate either of:
CF1=1: A1 is less than B1; B1 is less than C1 and A1 is less than C1
CF2=2: A1 is less than B1; B1 is greater than or equal to C1 and A1 is less than C1
CF3=3: A1 is less than B1; B1 is greater than or equal to C1 and A1 is greater than or equal to C1
CF4=4: A1 is greater than or equal to B1; B1 is greater than or equal to C1 and A1 is greater than or equal to C1
CF5=5: A1 is greater than or equal to B1; B1 is less than C1 and A1 is greater than or equal to C1
CF6=6: A1 is greater than or equal to B1; B1 is greater than or equal to C1 and A1 is less than C1



What should the formula be in the CF? Thanx in adv.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
.
.

Please clarify: are you talking about conditional formatting or custom functions?
 
Upvote 0
CF1=1: A1 is less than B1; B1 is less than C1 and A1 is less than C1
CF2=2: A1 is less than B1; B1 is greater than or equal to C1 and A1 is less than C1
CF3=3: A1 is less than B1; B1 is greater than or equal to C1 and A1 is greater than or equal to C1
CF4=4: A1 is greater than or equal to B1; B1 is greater than or equal to C1 and A1 is greater than or equal to C1
CF5=5: A1 is greater than or equal to B1; B1 is less than C1 and A1 is greater than or equal to C1
CF6=6: A1 is greater than or equal to B1; B1 is greater than or equal to C1 and A1 is less than C1


=and(a1<B1,B1<C1,A1<C1)
=and(a1<B1,B1>=C1,A1<C1)
=and(a1<B1,B1>=C1,A1>=C1)
=and(a1>=B1,B1>=C1,A1>=C1)
=and(a1>=B1,B1<C1,A1>=C1)
=and(a1>=B1,B1>=C1,A1<C1)
 
Last edited:
Upvote 0
You need to put a space after < so it's not interpreted as the start of an html tag.
 
Upvote 0
CF6=6: A1 is greater than or equal to B1; B1 is greater than or equal to C1 and A1 is less than C1
That one, at least, is impossible.
 
Upvote 0
Aside from the row with the question marks, does the result column look correct?

[Table="width:, class:grid"][tr][td] [/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][/tr]
[tr][td]
1​
[/td][td]
A1
[/td][td]
B1
[/td][td]
C1
[/td][td]
result
[/td][/tr]

[tr][td]
2​
[/td][td]
0​
[/td][td]
0​
[/td][td]
0​
[/td][td]
4​
[/td][/tr]

[tr][td]
3​
[/td][td]
1​
[/td][td]
0​
[/td][td]
1​
[/td][td]
5​
[/td][/tr]

[tr][td]
4​
[/td][td]
0​
[/td][td]
0​
[/td][td]
1​
[/td][td]
??​
[/td][/tr]

[tr][td]
5​
[/td][td]
0​
[/td][td]
1​
[/td][td]
0​
[/td][td]
3​
[/td][/tr]

[tr][td]
6​
[/td][td]
0​
[/td][td]
1​
[/td][td]
1​
[/td][td]
2​
[/td][/tr]

[tr][td]
7​
[/td][td]
0​
[/td][td]
1​
[/td][td]
2​
[/td][td]
1​
[/td][/tr]
[/table]


The formula in E2 and down is

=CHOOSE(4*(A2>=B2) + 2*(B2>=C2) + (A2>=C2) + 1, 1, "impossible", 2, 3, "??", 5, "impossible", 4)

What should be the result in row 4?
 
Upvote 0
Just need a place to park this:

[Table="width:, class:grid"][tr][td] [/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][/tr]
[tr][td]
9​
[/td][td]
Case
[/td][td]
A1:B1
[/td][td]
B1:C1
[/td][td]
A1:C1
[/td][td]
CF
[/td][/tr]

[tr][td]
10​
[/td][td]
0​
[/td][td]
<​
[/td][td]
<​
[/td][td]
<​
[/td][td]
1​
[/td][/tr]

[tr][td]
11​
[/td][td]
1​
[/td][td]
<​
[/td][td]
<​
[/td][td]
>=​
[/td][td]
impossible​
[/td][/tr]

[tr][td]
12​
[/td][td]
2​
[/td][td]
<​
[/td][td]
>=​
[/td][td]
<​
[/td][td]
2​
[/td][/tr]

[tr][td]
13​
[/td][td]
3​
[/td][td]
<​
[/td][td]
>=​
[/td][td]
>=​
[/td][td]
3​
[/td][/tr]

[tr][td]
14​
[/td][td]
4​
[/td][td]
>=​
[/td][td]
<​
[/td][td]
<​
[/td][td]
??​
[/td][/tr]

[tr][td]
15​
[/td][td]
5​
[/td][td]
>=​
[/td][td]
<​
[/td][td]
>=​
[/td][td]
5​
[/td][/tr]

[tr][td]
16​
[/td][td]
6​
[/td][td]
>=​
[/td][td]
>=​
[/td][td]
<​
[/td][td]
impossible​
[/td][/tr]

[tr][td]
17​
[/td][td]
7​
[/td][td]
>=​
[/td][td]
>=​
[/td][td]
>=​
[/td][td]
4​
[/td][/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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