# IF statement - [Solved/Closed]

Le0n2 - Feb 16, 2017 at 11:50 AM - Latest reply: Mazzaropi 1792 Posts Monday August 16, 2010Registration dateContributorStatus March 18, 2018 Last seen - Feb 16, 2017 at 01:25 PM
Hello,

I'm attempting to create an IF statement.

IF a type = 1 then add the total of a corresponding cell to the total amount.

`=SUM(IF(B24:B51="1"`
I've got this far pertaining to the type, but just need to add the total from another cell.

Example

Totals
Type 1 = 239.40
Type 2 = 40.30

Cell 1 |Cell 2
Type | Amount
1 |239.40
1 |17.30 < I need this to add to the total amount of Type 1 etc
2 |40.20
See more

## 3 replies

Mazzaropi 1792 Posts Monday August 16, 2010Registration dateContributorStatus March 18, 2018 Last seen -
0
Le0n2, Good afternoon.

Scenario:

......A..........B.......C...D.......E..............F........
1..Type...Amount...............TYPE.......TOTAL
2....1.......239.40..................1.........FORMULA
3....1.........17.30..................2........FORMULA
4....2.........40.20

Try to use:

=SUMIF (\$A\$2:\$A\$4, \$E2, \$B\$2:\$B\$4)

Copy it down.

Is that what you want?
I hope it helps.
--
Belo Horizonte, Brasil.
Marcílio Lobão
Le0n2 -
0
Hello Marcílio,

It worked! Exactly what I needed.

I had to think about the logic for a bit but I understand now.

Tom
Mazzaropi 1792 Posts Monday August 16, 2010Registration dateContributorStatus March 18, 2018 Last seen -
0