Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default Anyway to put logic into a single countif, sumif etc?

Is there anyway to countif for multiple things?

like = countif(Range, "1" or "2")

I know you can do "<1" dor does not equal but can you do combos within a
countif or do you have to run multiple countifs

Thanks
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 124
Default Anyway to put logic into a single countif, sumif etc?

Hi there Blue,

Yes, there is. You can either use two COUNTIF() functions...

=COUNTIF(A2:A10,"=1")+COUNTIF(A2:A10,"=2")

Or you can use a slight workaround for using only one function...

=SUMPRODUCT((A2:A10=1)+(A2:A10=2))

Change the range(s) to suit. Note if you are using the SUMPRODUCT()
function the ranges must be exactly the same in dimensions. The COUNTIF()
should work faster though.

HTH

--
Zack Barresse



"BlueWolverine" wrote in message
...
Is there anyway to countif for multiple things?

like = countif(Range, "1" or "2")

I know you can do "<1" dor does not equal but can you do combos within a
countif or do you have to run multiple countifs

Thanks
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Anyway to put logic into a single countif, sumif etc?

Try this:

=SUM(COUNTIF(Range,{"1","2"}))


"BlueWolverine" wrote:

Is there anyway to countif for multiple things?

like = countif(Range, "1" or "2")

I know you can do "<1" dor does not equal but can you do combos within a
countif or do you have to run multiple countifs

Thanks
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default Anyway to put logic into a single countif, sumif etc?

Thank you! I Particularly like the sum(countif({})) method!

--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!


"Teethless mama" wrote:

Try this:

=SUM(COUNTIF(Range,{"1","2"}))


"BlueWolverine" wrote:

Is there anyway to countif for multiple things?

like = countif(Range, "1" or "2")

I know you can do "<1" dor does not equal but can you do combos within a
countif or do you have to run multiple countifs

Thanks
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Anyway to put logic into a single countif, sumif etc?

Is there a way to do the same thing with a cell?

=SUM(COUNTIF(023:Q23, 024 or P24)

I've tried and it returns a "0".

Thanks, Terry


On Apr 28, 1:12*pm, BlueWolverine
wrote:
Thank you! I Particularly like thesum(countif({})) method!

--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!



"Teethless mama" wrote:
Try this:


=SUM(COUNTIF(Range,{"1","2"}))


"BlueWolverine" wrote:


Is there anyway tocountiffor multiple things? *


like =countif(Range, "1" or "2")


I know you can do "<1" dor does not equal but can you do combos within a
countifor do you have to run multiple countifs


Thanks
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!- Hide quoted text -


- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 124
Default Anyway to put logic into a single countif, sumif etc?

=COUNTIF(O23:Q23,O24)+COUNTIF(O23:Q23,P24)

--
Zack Barresse




"Tmaxx02" wrote in message
...
Is there a way to do the same thing with a cell?

=SUM(COUNTIF(023:Q23, 024 or P24)

I've tried and it returns a "0".

Thanks, Terry


On Apr 28, 1:12 pm, BlueWolverine
wrote:
Thank you! I Particularly like thesum(countif({})) method!

--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!



"Teethless mama" wrote:
Try this:


=SUM(COUNTIF(Range,{"1","2"}))


"BlueWolverine" wrote:


Is there anyway tocountiffor multiple things?


like =countif(Range, "1" or "2")


I know you can do "<1" dor does not equal but can you do combos
within a
countifor do you have to run multiple countifs


Thanks
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!- Hide quoted text -


- Show quoted text -


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 124
Default Anyway to put logic into a single countif, sumif etc?

Or..

=COUNT(IF((O23:Q23=O24)+(O23:Q23=P24),O23:Q23))

Confirmed with Ctrl + Shfit + Enter

--
Zack Barresse



"Tmaxx02" wrote in message
...
Is there a way to do the same thing with a cell?

=SUM(COUNTIF(023:Q23, 024 or P24)

I've tried and it returns a "0".

Thanks, Terry


On Apr 28, 1:12 pm, BlueWolverine
wrote:
Thank you! I Particularly like thesum(countif({})) method!

--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!



"Teethless mama" wrote:
Try this:


=SUM(COUNTIF(Range,{"1","2"}))


"BlueWolverine" wrote:


Is there anyway tocountiffor multiple things?


like =countif(Range, "1" or "2")


I know you can do "<1" dor does not equal but can you do combos
within a
countifor do you have to run multiple countifs


Thanks
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!- Hide quoted text -


- Show quoted text -


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
COUNTIF with AND logic Mitchell_Collen via OfficeKB.com Excel Worksheet Functions 8 June 19th 07 11:02 PM
Countif Using Multiple Logic Tests Carl Excel Worksheet Functions 3 June 4th 06 07:09 AM
Using 'AND' logic in a SUMIF statement IpcTrain Excel Worksheet Functions 2 March 10th 06 05:39 PM
COUNTIF with Logic? Leonhardtk Excel Worksheet Functions 3 January 10th 06 11:09 PM
Countif with AND logic mlkpied Excel Worksheet Functions 8 December 9th 04 11:47 AM


All times are GMT +1. The time now is 03:19 AM.

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

About Us

"It's about Microsoft Excel"