ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   MULTIPLE IF STATEMENTS PULLING DATA FROM MORE THAN ONE COLUMN (https://www.excelbanter.com/excel-discussion-misc-queries/235721-multiple-if-statements-pulling-data-more-than-one-column.html)

Jeremy A.

MULTIPLE IF STATEMENTS PULLING DATA FROM MORE THAN ONE COLUMN
 
For the spreadsheet below, column A is the initials of a salesperson and
column B is the type of deal (f is a finance, c is a cash and L is a lease
deal. I want to count the number of L's there are for GR and CC.

I have tried many combinations of IF statements and cant figure out how to
combine the two. How many times does L appear in column B when CC is in
column A? Once I get it for one, I can make the necessary changes to count
the rest.

My spreadsheet looks like this
column
A B
GR L
GR L
CC C
CC L
CC L
CC L
GR F
GR C
CC C
GR L
CC L
CC C
CC L
GR F
CC L


T. Valko

MULTIPLE IF STATEMENTS PULLING DATA FROM MORE THAN ONE COLUMN
 
How many times does L appear in column B
when CC is in column A?


Try this:

=SUMPRODUCT(--(A1:A10="CC"),--(B1:B10="L"))

Better to use cells to hold the criteria:

D1 = CC
E1 = L

=SUMPRODUCT(--(A1:A10=D1),--(B1:B10=E1))


--
Biff
Microsoft Excel MVP


"Jeremy A." <Jeremy wrote in message
...
For the spreadsheet below, column A is the initials of a salesperson and
column B is the type of deal (f is a finance, c is a cash and L is a lease
deal. I want to count the number of L's there are for GR and CC.

I have tried many combinations of IF statements and cant figure out how to
combine the two. How many times does L appear in column B when CC is in
column A? Once I get it for one, I can make the necessary changes to count
the rest.

My spreadsheet looks like this
column
A B
GR L
GR L
CC C
CC L
CC L
CC L
GR F
GR C
CC C
GR L
CC L
CC C
CC L
GR F
CC L




Jeremy A.[_2_]

MULTIPLE IF STATEMENTS PULLING DATA FROM MORE THAN ONE COLUMN
 
Thank you so much! It worked great!!

"T. Valko" wrote:

How many times does L appear in column B
when CC is in column A?


Try this:

=SUMPRODUCT(--(A1:A10="CC"),--(B1:B10="L"))

Better to use cells to hold the criteria:

D1 = CC
E1 = L

=SUMPRODUCT(--(A1:A10=D1),--(B1:B10=E1))


--
Biff
Microsoft Excel MVP


"Jeremy A." <Jeremy wrote in message
...
For the spreadsheet below, column A is the initials of a salesperson and
column B is the type of deal (f is a finance, c is a cash and L is a lease
deal. I want to count the number of L's there are for GR and CC.

I have tried many combinations of IF statements and cant figure out how to
combine the two. How many times does L appear in column B when CC is in
column A? Once I get it for one, I can make the necessary changes to count
the rest.

My spreadsheet looks like this
column
A B
GR L
GR L
CC C
CC L
CC L
CC L
GR F
GR C
CC C
GR L
CC L
CC C
CC L
GR F
CC L





T. Valko

MULTIPLE IF STATEMENTS PULLING DATA FROM MORE THAN ONE COLUMN
 
You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Jeremy A." wrote in message
...
Thank you so much! It worked great!!

"T. Valko" wrote:

How many times does L appear in column B
when CC is in column A?


Try this:

=SUMPRODUCT(--(A1:A10="CC"),--(B1:B10="L"))

Better to use cells to hold the criteria:

D1 = CC
E1 = L

=SUMPRODUCT(--(A1:A10=D1),--(B1:B10=E1))


--
Biff
Microsoft Excel MVP


"Jeremy A." <Jeremy wrote in message
...
For the spreadsheet below, column A is the initials of a salesperson
and
column B is the type of deal (f is a finance, c is a cash and L is a
lease
deal. I want to count the number of L's there are for GR and CC.

I have tried many combinations of IF statements and cant figure out how
to
combine the two. How many times does L appear in column B when CC is in
column A? Once I get it for one, I can make the necessary changes to
count
the rest.

My spreadsheet looks like this
column
A B
GR L
GR L
CC C
CC L
CC L
CC L
GR F
GR C
CC C
GR L
CC L
CC C
CC L
GR F
CC L








All times are GMT +1. The time now is 11:52 AM.

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