user1908486
user1908486

Reputation: 23

how to do a sum if another cell contains a certain 'word

I have a sales sheet columns along this format

------------------------------------------------
|     A   |      B    |    C       |   D       |   
------------------------------------------------
|  type  |   Cost     | card fee   |    Total  |
------------------------------------------------
| cash   | 10.00      | 0.00       | 10.00     |
------------------------------------------------
| visa   | 10.00      | 0.50       | 10.50     |
------------------------------------------------

I currently put the values in B and C manually and then (D) sums the Total

What I want to do is have the cardfee (C) column do the calculate the sum B*5% only if (A) is = 'visa' but if its anything else (C) can be blank or 0.00

Upvotes: 2

Views: 4189

Answers (1)

Mattias Josefsson
Mattias Josefsson

Reputation: 1197

Try the IF function =IF ( condition, if_true, otherwise_value )

=IF(A2 = "visa", B2*0.05, 0.00)

Upvotes: 3

Related Questions