close

A4=IF(COUNTIF(A1:AS1,1)=2,1,quot;quot;)

The above formula searches a range of cells looking for the number 1
occurring 2 times and either returning 1 or leaving the cell blank.

How could the formula be changed to only do the search if cell A1 was equal
to the number 1?

=if(A1=1,true result, false result)

quot;Cliffquot; wrote:

gt; A4=IF(COUNTIF(A1:AS1,1)=2,1,quot;quot;)
gt;
gt; The above formula searches a range of cells looking for the number 1
gt; occurring 2 times and either returning 1 or leaving the cell blank.
gt;
gt; How could the formula be changed to only do the search if cell A1 was equal
gt; to the number 1?


Cliff,

=IF(A1=1,IF(COUNTIF(A1:AS1,1)=2,1,quot;quot;),quot;quot;)

HTH

Steve--
SteveG
------------------------------------------------------------------------
SteveG's Profile: www.excelforum.com/member.php...foamp;userid=7571
View this thread: www.excelforum.com/showthread...hreadid=529598Thank you, it worked great.

One additional request, how could this one formula be changed to include the
additional range of cells at A6:E6 with the original range of A1:AS1?

quot;SteveGquot; wrote:

gt;
gt; Cliff,
gt;
gt; =IF(A1=1,IF(COUNTIF(A1:AS1,1)=2,1,quot;quot;),quot;quot;)
gt;
gt; HTH
gt;
gt; Steve
gt;
gt;
gt; --
gt; SteveG
gt; ------------------------------------------------------------------------
gt; SteveG's Profile: www.excelforum.com/member.php...foamp;userid=7571
gt; View this thread: www.excelforum.com/showthread...hreadid=529598
gt;
gt;


So you want to COUNTIF A1:AS1 and A6:E6 if they are equal to 1 and add
them together to see if the sum = 2?

=IF(A1=1,IF(COUNTIF(A1:AS1,1) COUNTIF(A6:E6,1)=2,1 ,quot;quot;),quot;quot;)

If you want it to look to see if either range's count of the number 1
returns a value of 2 then,

=IF(A1=1,IF(OR(COUNTIF(A1:AS1,1)=2,COUNTIF(A6:E6,1 )=2),1,quot;quot;),quot;quot;)

HTH

Steve--
SteveG
------------------------------------------------------------------------
SteveG's Profile: www.excelforum.com/member.php...foamp;userid=7571
View this thread: www.excelforum.com/showthread...hreadid=529598Thanks, the first one is what I needed.

quot;SteveGquot; wrote:

gt;
gt; So you want to COUNTIF A1:AS1 and A6:E6 if they are equal to 1 and add
gt; them together to see if the sum = 2?
gt;
gt; =IF(A1=1,IF(COUNTIF(A1:AS1,1) COUNTIF(A6:E6,1)=2,1 ,quot;quot;),quot;quot;)
gt;
gt; If you want it to look to see if either range's count of the number 1
gt; returns a value of 2 then,
gt;
gt; =IF(A1=1,IF(OR(COUNTIF(A1:AS1,1)=2,COUNTIF(A6:E6,1 )=2),1,quot;quot;),quot;quot;)
gt;
gt; HTH
gt;
gt; Steve
gt;
gt;
gt; --
gt; SteveG
gt; ------------------------------------------------------------------------
gt; SteveG's Profile: www.excelforum.com/member.php...foamp;userid=7571
gt; View this thread: www.excelforum.com/showthread...hreadid=529598
gt;
gt;


Glad I could help.

Steve--
SteveG
------------------------------------------------------------------------
SteveG's Profile: www.excelforum.com/member.php...foamp;userid=7571
View this thread: www.excelforum.com/showthread...hreadid=529598

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()