ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If statement ... help needed. (https://www.excelbanter.com/excel-worksheet-functions/122435-if-statement-help-needed.html)

parsonsamie

If statement ... help needed.
 
Hi,

I have a spreadsheet that looks like this;

Rate Weeks Required
150 4.33 1
120 4.33 0

And this continues on for 34 lines.

I need to be able to get one total.

If the value in "Required" = 1 then Rate * Weeks .... adding a culmative total for all 34 rows.

Does anyone know of a single formula that can accomplish this or code for it.

Thanx

JMB

If statement ... help needed.
 
Assuming "Required" will only be either a 1 or a 0:
=SUMPRODUCT(A2:A35, B2:B35, C2:C35)

otherwise
=SUMPRODUCT(A2:A35, B2:B35, --(C2:C35=1))


"parsonsamie" wrote:


Hi,

I have a spreadsheet that looks like this;

Rate Weeks Required
150 4.33 1
120 4.33 0

And this continues on for 34 lines.

I need to be able to get one total.

If the value in "Required" = 1 then Rate * Weeks .... adding a
culmative total for all 34 rows.

Does anyone know of a single formula that can accomplish this or code
for it.

Thanx




--
parsonsamie


T. Valko

If statement ... help needed.
 
Try this:

=SUMPRODUCT(A2:A35,B2:B35,--(C2:C35=1))

Biff

"parsonsamie" wrote in message
...

Hi,

I have a spreadsheet that looks like this;

Rate Weeks Required
150 4.33 1
120 4.33 0

And this continues on for 34 lines.

I need to be able to get one total.

If the value in "Required" = 1 then Rate * Weeks .... adding a
culmative total for all 34 rows.

Does anyone know of a single formula that can accomplish this or code
for it.

Thanx




--
parsonsamie




parsonsamie

Thank you both for your help .... so simple when you put it like that. :-)

Thanx
xx


Quote:

Originally Posted by T. Valko
Try this:

=SUMPRODUCT(A2:A35,B2:B35,--(C2:C35=1))

Biff

"parsonsamie" wrote in message
...

Hi,

I have a spreadsheet that looks like this;

Rate Weeks Required
150 4.33 1
120 4.33 0

And this continues on for 34 lines.

I need to be able to get one total.

If the value in "Required" = 1 then Rate * Weeks .... adding a
culmative total for all 34 rows.

Does anyone know of a single formula that can accomplish this or code
for it.

Thanx




--
parsonsamie



All times are GMT +1. The time now is 07:51 PM.

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