ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Need help with IF Formula (https://www.excelbanter.com/excel-discussion-misc-queries/234153-need-help-if-formula.html)

Fgbdrum

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.

RagDyeR

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.



Bernard Liengme[_3_]

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.




Pete_UK

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.



Eduardo

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.



All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com