# "this sum" or "that sum" dependant on Criteria?

#### Bench

##### Board Regular
Hi,

I have two ways of working out profit depending on which company we send work to.

I would like to write a function that takes this into account and does the math either way. I'm thinking this may be a SUMPRODUCT but not entirely sure.

Example:

Column A=Company
Column B=Gross Fee
Column C=Their Fee
Column D=Profit

For Company B the math is simple B-C= Profit
For Company A the math is B-85, regardless of the figure in Column C

Is their way to do this, ie.

If A=Company A, Then D=B-85
If A=Company B, Then D=B-C

### Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

##### Board Regular
If I understood correctly, this will do the trick
Code:
``=IF(A1="A",B1-85,B1-C1)``
where "A" is name of company

#### Bench

##### Board Regular
If I understood correctly, this will do the trick
Code:
``=IF(A1="A",B1-85,B1-C1)``
where "A" is name of company

Yeah this works perfectly, thanks

Replies
6
Views
90
Replies
1
Views
16
Replies
20
Views
223
Replies
1
Views
159
Replies
4
Views
103