ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Countif, then multiply?? (https://www.excelbanter.com/excel-worksheet-functions/59244-countif-then-multiply.html)

Gee-off

Countif, then multiply??
 
A B C
1 S6 B2

I know how to use the countif function as if to count all values that equal
"S*" (value beginning with "S" only regardless of the following number) in a
row. Then tally, per row, the number of times "S*" appeared in the range.
The formula for "C1" would be: =countif(A1:B2,"S*") which right now would
return the value of 1. Now what I want to do is in addition to this formula,
I want "C1" to also calculate the countif portion and then multiply the
countif returned value by the second number in the stated cell. i.e. A1 =
S6, so "C1" has a value of "1", now mulitply the "1" by the second digit in
"A1" (which is 6). How would I go about this?


Gee-off

Countif, then multiply??
 
I guess what I am really trying to do is "add" the second digit of "A1" &
"B1" and put the sum in "C1".....so long as the first digit is an "S".

"Gee-off" wrote:

A B C
1 S6 S2

I know how to use the countif function as if to count all values that equal
"S*" (value beginning with "S" only regardless of the following number) in a
row. Then tally, per row, the number of times "S*" appeared in the range.
The formula for "C1" would be: =countif(A1:B2,"S*") which right now would
return the value of 1. Now what I want to do is in addition to this formula,
I want "C1" to also calculate the countif portion and then multiply the
countif returned value by the second number in the stated cell. i.e. A1 =
S6, so "C1" has a value of "1", now mulitply the "1" by the second digit in
"A1" (which is 6). How would I go about this?


Bob Phillips

Countif, then multiply??
 
How about

=RIGHT(A1,1)*(LEFT(A1,1)="S")+RIGHT(B1,1)*(LEFT(B1 ,1)="S")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Gee-off" wrote in message
...
I guess what I am really trying to do is "add" the second digit of "A1" &
"B1" and put the sum in "C1".....so long as the first digit is an "S".

"Gee-off" wrote:

A B C
1 S6 S2

I know how to use the countif function as if to count all values that

equal
"S*" (value beginning with "S" only regardless of the following number)

in a
row. Then tally, per row, the number of times "S*" appeared in the

range.
The formula for "C1" would be: =countif(A1:B2,"S*") which right now

would
return the value of 1. Now what I want to do is in addition to this

formula,
I want "C1" to also calculate the countif portion and then multiply the
countif returned value by the second number in the stated cell. i.e.

A1 =
S6, so "C1" has a value of "1", now mulitply the "1" by the second digit

in
"A1" (which is 6). How would I go about this?




Gee-off

Countif, then multiply??
 
Thank you, that worked perfectly. Now I am going to through each step of the
evaluation process and see exactly why. Thanks again.

"Bob Phillips" wrote:

How about

=RIGHT(A1,1)*(LEFT(A1,1)="S")+RIGHT(B1,1)*(LEFT(B1 ,1)="S")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Gee-off" wrote in message
...
I guess what I am really trying to do is "add" the second digit of "A1" &
"B1" and put the sum in "C1".....so long as the first digit is an "S".

"Gee-off" wrote:

A B C
1 S6 S2

I know how to use the countif function as if to count all values that

equal
"S*" (value beginning with "S" only regardless of the following number)

in a
row. Then tally, per row, the number of times "S*" appeared in the

range.
The formula for "C1" would be: =countif(A1:B2,"S*") which right now

would
return the value of 1. Now what I want to do is in addition to this

formula,
I want "C1" to also calculate the countif portion and then multiply the
countif returned value by the second number in the stated cell. i.e.

A1 =
S6, so "C1" has a value of "1", now mulitply the "1" by the second digit

in
"A1" (which is 6). How would I go about this?





Bob Phillips

Countif, then multiply??
 
Here is an alternative

=SUMPRODUCT(--(LEFT(A21:B21,1)="S"),--(RIGHT(A21:B21,1)))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Gee-off" wrote in message
...
Thank you, that worked perfectly. Now I am going to through each step of

the
evaluation process and see exactly why. Thanks again.

"Bob Phillips" wrote:

How about

=RIGHT(A1,1)*(LEFT(A1,1)="S")+RIGHT(B1,1)*(LEFT(B1 ,1)="S")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Gee-off" wrote in message
...
I guess what I am really trying to do is "add" the second digit of

"A1" &
"B1" and put the sum in "C1".....so long as the first digit is an "S".

"Gee-off" wrote:

A B C
1 S6 S2

I know how to use the countif function as if to count all values

that
equal
"S*" (value beginning with "S" only regardless of the following

number)
in a
row. Then tally, per row, the number of times "S*" appeared in the

range.
The formula for "C1" would be: =countif(A1:B2,"S*") which right

now
would
return the value of 1. Now what I want to do is in addition to this

formula,
I want "C1" to also calculate the countif portion and then multiply

the
countif returned value by the second number in the stated cell.

i.e.
A1 =
S6, so "C1" has a value of "1", now mulitply the "1" by the second

digit
in
"A1" (which is 6). How would I go about this?








All times are GMT +1. The time now is 05:14 AM.

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