Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cliff
 
Posts: n/a
Default Referencing a range of columns and rows with the IF function

I am trying to use the following IF function to search a range of cells to
find the number 1 and then return either 1 or leave the cell blank. However,
it does not look at the range of cells.

A4=IF(A1:AS3=1),1,""

Any sugestions would help.
--
Cliff
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Referencing a range of columns and rows with the IF function

=IF(COUNTIF(A1:AS3,1)0,1,"")

--

Regards,

Peo Sjoblom

Northwest Excel Solutions

www.nwexcelsolutions.com

(remove ^^ from email address)

Portland, Oregon




"Cliff" wrote in message
...
I am trying to use the following IF function to search a range of cells to
find the number 1 and then return either 1 or leave the cell blank.
However,
it does not look at the range of cells.

A4=IF(A1:AS3=1),1,""

Any sugestions would help.
--
Cliff


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Referencing a range of columns and rows with the IF function


If you want to return 1 if 1 occurs anywhere in that range

=IF(COUNTIF(A1:AS3,1),1,"")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=528879

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cliff
 
Posts: n/a
Default Referencing a range of columns and rows with the IF function

Thanks, but what does the ,1 after the range A1:AS3 stand for?
--
Cliff


"daddylonglegs" wrote:


If you want to return 1 if 1 occurs anywhere in that range

=IF(COUNTIF(A1:AS3,1),1,"")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=528879


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Referencing a range of columns and rows with the IF function


In this formula

=IF(COUNTIF(A1:AS3,1),1,"")

the first 1 is what you're counting within the range. If the count is 0
then the formula will return "", i.e. a blank, if the count is anything
else, i.e. 1 or higher the formula returns a 1.

If you were searching for something else in the range, e.g. a letter x
then the formula would be

=IF(COUNTIF(A1:AS3,"x"),1,"")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=528879



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Cliff
 
Posts: n/a
Default Referencing a range of columns and rows with the IF function

I really need to just identify 1 only and nothing higher i.e =1
--
Cliff


"daddylonglegs" wrote:


In this formula

=IF(COUNTIF(A1:AS3,1),1,"")

the first 1 is what you're counting within the range. If the count is 0
then the formula will return "", i.e. a blank, if the count is anything
else, i.e. 1 or higher the formula returns a 1.

If you were searching for something else in the range, e.g. a letter x
then the formula would be

=IF(COUNTIF(A1:AS3,"x"),1,"")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=528879


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Referencing a range of columns and rows with the IF function


Not quite sure what you're saying. Do you want the formula to return a 1
only when there is only a single 1 in the range?

If so

=IF(COUNTIF(A1:AS3,1)=1,1,"")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=528879

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
How to swap rows and columns? [email protected] Excel Discussion (Misc queries) 5 September 21st 05 08:07 AM
Help PLEASE! Not sure what answer is: Match? Index? Other? baz Excel Worksheet Functions 7 September 3rd 05 03:47 PM
Hide columns & rows that contain "0" or blank in a range of cells lw new guest Excel Worksheet Functions 0 August 18th 05 04:27 PM
inserting columns within certain rows only crimsonkng Excel Discussion (Misc queries) 4 July 14th 05 05:13 PM
extract data from a range of cells in rows or columns when a date. Dartyon Excel Worksheet Functions 0 February 24th 05 10:37 PM


All times are GMT +1. The time now is 06:01 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"