Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cliff
 
Posts: n/a
Default Help with formula

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

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default Help with formula

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

"Cliff" wrote:

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

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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default Help with formula


Cliff,

=IF(A1=1,IF(COUNTIF(A1:AS1,1)=2,1,""),"")

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=529598

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cliff
 
Posts: n/a
Default Help with formula

Thank 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?

"SteveG" wrote:


Cliff,

=IF(A1=1,IF(COUNTIF(A1:AS1,1)=2,1,""),"")

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=529598


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default Help with formula


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 ,""),"")

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,""),"")

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=529598



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cliff
 
Posts: n/a
Default Help with formula

Thanks, the first one is what I needed.

"SteveG" wrote:


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 ,""),"")

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,""),"")

HTH

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=529598


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SteveG
 
Posts: n/a
Default Help with formula


Glad I could help.

Steve


--
SteveG
------------------------------------------------------------------------
SteveG's Profile: http://www.excelforum.com/member.php...fo&userid=7571
View this thread: http://www.excelforum.com/showthread...hreadid=529598

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
2 Nesting questions Starchaser Excel Worksheet Functions 7 January 20th 06 06:53 PM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"