Check is range is logical

Orongo

Board Regular
Joined
Nov 6, 2011
Messages
83
Hi, I have 3 columns that are either true or false. For every row there can only be one true. I want to create a column that checks this, not using any macro. I understand I can make a nested formula with many ifs, but it seems like there should be a simpler way. Is there?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi Orongo

Try this:

=IF(COUNTIF(B2:D2,"TRUE")>1,"Check","Ok")

Where B2:D2 are the three columns are either true or false.

Have fun!

cheers

pvr928
 
Upvote 0
Try this:

=IF(COUNTIF(B2:D2,"TRUE")>1,"Check","Ok")

Where B2:D2 are the three columns are either true or false.
You should change your "greater than" sign to a "not equal" sign just in case those three cells are all FALSE.

=IF(COUNTIF(B2:D2,"TRUE")<>1,"Check","Ok")

Although I would eliminate the COUNTIF function call and use this simpler construction instead...

=IF(B2+C2+D2=1,"Ok","Check")
 
Upvote 0
You should change your "greater than" sign to a "not equal" sign just in case those three cells are all FALSE.

=IF(COUNTIF(B2:D2,"TRUE")<>1,"Check","Ok")

Although I would eliminate the COUNTIF function call and use this simpler construction instead...

=IF(B2+C2+D2=1,"Ok","Check")

Nice one Rick - I keep forgetting the power of boolean functions!

Cheers

pvr928
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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