Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default coutif problem


i have a list of names in one worksheet, i used a countif formula to
count the number of names - but how do i replace the zero when a data
is not found to somethin else such as 'error' or 'not found'??

hope someone can help


--
hsb101
------------------------------------------------------------------------
hsb101's Profile: http://www.excelforum.com/member.php...o&userid=37049
View this thread: http://www.excelforum.com/showthread...hreadid=567749

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,688
Default coutif problem

Hi!

Try this:

=IF(COUNTIF(A1:A10,"some_name"),COUNTIF(A1:A10,"so me_name"),"Not Found")

Biff

"hsb101" wrote in
message ...

i have a list of names in one worksheet, i used a countif formula to
count the number of names - but how do i replace the zero when a data
is not found to somethin else such as 'error' or 'not found'??

hope someone can help


--
hsb101
------------------------------------------------------------------------
hsb101's Profile:
http://www.excelforum.com/member.php...o&userid=37049
View this thread: http://www.excelforum.com/showthread...hreadid=567749



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default coutif problem


i got it i think...i just used this formula...

=IF(COUNTIF(A4:B45,D7),COUNTIF(A4:B45,D7),"Not Found")

why does this formula work when i use the logical test being the same
as the true value?


--
hsb101
------------------------------------------------------------------------
hsb101's Profile: http://www.excelforum.com/member.php...o&userid=37049
View this thread: http://www.excelforum.com/showthread...hreadid=567749

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,688
Default coutif problem

"hsb101" wrote...
i got it i think...i just used this formula...
=IF(COUNTIF(A4:B45,D7),COUNTIF(A4:B45,D7),"Not Found")
why does this formula work when i use the logical test being the same
as the true value?


The logical test: COUNTIF(A4:B45,D7), will return a number, either 0 or some
number greater than 0.

When it returns 0 the logical test evaluates to FALSE and the formula
returns "Not Found".

When the logical test returns ANY number other than 0 then the logical test
evaluates to TRUE and performs the second Countif.

It can also be expressed as:

=IF(COUNTIF(A4:B45,D7)0,COUNTIF(A4:B45,D7),"Not Found")

But my version saves 2 keystrokes and and 1 evaluation step! <g

Biff


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
have some problem with database baldamenti Excel Discussion (Misc queries) 1 October 13th 05 05:38 PM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM
Problem With Reference Update Egon Excel Worksheet Functions 17 July 16th 05 05:45 AM
Copy an Drag cell Formula Problem Nat Excel Discussion (Misc queries) 1 June 20th 05 03:24 PM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM


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