Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Need help with IF Formula

Hi-

In principal, I'd like to do a COUNTIF statement within an IF statement.
Can't seem to get it to work just right. Here's my sheet:

Column A Column B
A APPLE
B ORANGE
F APPLE

I'd like the formula to say:

If column B equals APPLE, count column A if it equals F.

This would give me a return of 1.

Would appreciate any help on this. Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Need help with IF Formula

Try this:

=Sumproduct((a1:a100="F")*(B1:B100="Apple"))
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"Fgbdrum" wrote in message
...
Hi-

In principal, I'd like to do a COUNTIF statement within an IF statement.
Can't seem to get it to work just right. Here's my sheet:

Column A Column B
A APPLE
B ORANGE
F APPLE

I'd like the formula to say:

If column B equals APPLE, count column A if it equals F.

This would give me a return of 1.

Would appreciate any help on this. Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,104
Default Need help with IF Formula

=SUMPRODUCT(--(B1:B100="Apple"),--(A1:A100="F"))
If you are using Excel 2007
=SUMPRODUCT(--(B:B="Apple"),--(A:A="F"))
or
=COUNTIFS(A:A,"F",B:B,"Apple")
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Fgbdrum" wrote in message
...
Hi-

In principal, I'd like to do a COUNTIF statement within an IF statement.
Can't seem to get it to work just right. Here's my sheet:

Column A Column B
A APPLE
B ORANGE
F APPLE

I'd like the formula to say:

If column B equals APPLE, count column A if it equals F.

This would give me a return of 1.

Would appreciate any help on this. Thank you.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Need help with IF Formula

Try this:

=SUMPRODUCT((B$1:B$20="Apple")*(A$1:A$20="F"))

You could put Apple and F into some other cells, and then refer to
those cells in the formula rather than the specific values.

Hope this helps.

Pete

On Jun 17, 4:11*pm, Fgbdrum wrote:
Hi-

In principal, I'd like to do a COUNTIF statement within an IF statement.
Can't seem to get it to work just right. Here's my sheet:

Column A * * * * * Column B
A * * * * * * * * * * * * APPLE * * * * * * * * * * *
B * * * * * * * * * * * * ORANGE
F * * * * * * * * * * * * APPLE

I'd like the formula to say:

If column B equals APPLE, count column A if it equals F.

This would give me a return of 1.

Would appreciate any help on this. Thank you.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default Need help with IF Formula

Hi,
try

=SUMPRODUCT(--(B1:B300="Apple"),--(A1:A300="F"))

"Fgbdrum" wrote:

Hi-

In principal, I'd like to do a COUNTIF statement within an IF statement.
Can't seem to get it to work just right. Here's my sheet:

Column A Column B
A APPLE
B ORANGE
F APPLE

I'd like the formula to say:

If column B equals APPLE, count column A if it equals F.

This would give me a return of 1.

Would appreciate any help on this. Thank you.

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



All times are GMT +1. The time now is 08:34 PM.

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"