Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Which (logical) function?

Table was codes...if the ID begins with a w and the number in the second
column is a 1 add the ones (which are male ;)

A B
1 ID Gender
2 W01 2
3 W02 1
4 G01 1
5 W08 1

I have: =COUNTIF(A$2:$A$5,"=w??")*AND(COUNTIF(B$2:$B$5,"1" ))...which isn't
correct because it returns 3 (all the w's) I suppose.

What do I do???

TIA!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Which (logical) function?

For more than one criteria, use Sumproduct, as in:
=sumproduct((left(a2:a5)="w")*(b2:b5=1))

Regards,
Fred

"JustJill" wrote in message
...
Table was codes...if the ID begins with a w and the number in the second
column is a 1 add the ones (which are male ;)

A B
1 ID Gender
2 W01 2
3 W02 1
4 G01 1
5 W08 1

I have: =COUNTIF(A$2:$A$5,"=w??")*AND(COUNTIF(B$2:$B$5,"1" ))...which
isn't
correct because it returns 3 (all the w's) I suppose.

What do I do???

TIA!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Which (logical) function?

Sorry, make that:
=sumproduct((left(a2:a5,1)="w")*(b2:b5=1))

Fred

"Fred Smith" wrote in message
...
For more than one criteria, use Sumproduct, as in:
=sumproduct((left(a2:a5)="w")*(b2:b5=1))

Regards,
Fred

"JustJill" wrote in message
...
Table was codes...if the ID begins with a w and the number in the second
column is a 1 add the ones (which are male ;)

A B
1 ID Gender
2 W01 2
3 W02 1
4 G01 1
5 W08 1

I have: =COUNTIF(A$2:$A$5,"=w??")*AND(COUNTIF(B$2:$B$5,"1" ))...which
isn't
correct because it returns 3 (all the w's) I suppose.

What do I do???

TIA!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Which (logical) function?

Another way

=SUMPRODUCT(--(LEFT(A1:A5)&(B1:B5)="W1"))

--
Jacob (MVP - Excel)


"JustJill" wrote:

Table was codes...if the ID begins with a w and the number in the second
column is a 1 add the ones (which are male ;)

A B
1 ID Gender
2 W01 2
3 W02 1
4 G01 1
5 W08 1

I have: =COUNTIF(A$2:$A$5,"=w??")*AND(COUNTIF(B$2:$B$5,"1" ))...which isn't
correct because it returns 3 (all the w's) I suppose.

What do I do???

TIA!

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
Logical function please Amin Excel Worksheet Functions 3 April 16th 10 09:44 AM
Logical Function DJ Excel Worksheet Functions 1 August 22nd 09 01:44 AM
Help!!! - logical function for someone not very logical ECH123 Excel Worksheet Functions 3 May 11th 09 04:14 PM
Help with logical function PT Excel Worksheet Functions 2 February 22nd 08 02:13 AM
should it be if() or another logical function? Gina Excel Worksheet Functions 2 November 10th 06 05:59 PM


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