Combining IF(OR & IF(AND Statements

Stealth2016

New Member
Joined
Oct 26, 2016
Messages
34
I have the following statements that ascertain whether a 1 or 0 is shown in a destination cell. I have been trying to combine both statements with no luck.

Code:
=IF(OR(T29="W"),1,ROUNDDOWN(COUNTIF(T29:T33,"W")/2,0))

Code:
=IF(AND(T29="W"),ROUNDDOWN(COUNTIF(AR29:AR33,"W"=2),0))

Is it possible to combine them or do I have to come up with a different formula altogether.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
could you state the condition cell the show 0 & 1 please
 
Upvote 0
when i meant was

if T29 = "W" and what condition required to assign 0 or 1 to AX67?
 
Upvote 0
If T29="W" it will put a 1 in AX67 but if AR29:AR33,"W"=2 then I want a 0 in AX67 but if T29="W" or T29:T33,"W"=2 then I want a 1 in AX67
 
Upvote 0
What I am after is IF T29="W" or T29:T33,"W"=2 a 1 will be in AX67 but if both T29="W" and AR29:AR33,"W"=2 I want 0 in AX67
 
Upvote 0
may be


Book1
TAR
29WW
30
31W
32
33
34
66
671
Sheet1
Cell Formulas
RangeFormula
T67=IF(T29="W",IF(COUNTIF(T29:T33,"W")=2,1,IF(COUNTIF(AR29:AR33,"W")=2,0,"")),"")



Book1
TAR
29WW
30
31
32W
33
34
66
670
Sheet1
Cell Formulas
RangeFormula
T67=IF(T29="W",IF(COUNTIF(T29:T33,"W")=2,1,IF(COUNTIF(AR29:AR33,"W")=2,0,"")),"")


note that when both conditions met it will yield 1.


Book1
TAR
29WW
30
31
32W
33W
34
66
671
Sheet1
Cell Formulas
RangeFormula
T67=IF(T29="W",IF(COUNTIF(T29:T33,"W")=2,1,IF(COUNTIF(AR29:AR33,"W")=2,0,"")),"")


and only work with "W" = 2, not greater.


Book1
TAR
29WW
30
31
32W
33W
34
66
67 
Sheet1
Cell Formulas
RangeFormula
T67=IF(T29="W",IF(COUNTIF(T29:T33,"W")=2,1,IF(COUNTIF(AR29:AR33,"W")=2,0,"")),"")
 
Upvote 0
Thanks AlanY. This is not quite what I need. I need a 1 in AX67 if T29="W" even if it is the only cell with a "W"in it unless AR29:AR33,"W"=2 and a 1 in AX67 if T29:T33,"W"=2.
 
Upvote 0
ok, try this

=IF(COUNTIF(AR29:AR33,"W")=2,0,if(or(T29="W",COUNTIF(T29:T33,"W")=2),1,""))
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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