IF statement - [Solved/Closed]

Le0n2 - Feb 16, 2017 at 11:50 AM - Latest reply: Mazzaropi 1829 Posts Monday August 16, 2010Registration dateContributorStatus May 7, 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 1829 Posts Monday August 16, 2010Registration dateContributorStatus May 7, 2018 Last seen - Feb 16, 2017 at 12:03 PM
0
Helpful
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
0
Helpful
Hello Marcílio,

It worked! Exactly what I needed.

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

Muito apreciado!

Tom
Mazzaropi 1829 Posts Monday August 16, 2010Registration dateContributorStatus May 7, 2018 Last seen - Feb 16, 2017 at 01:25 PM
0
Helpful
Le0n2,

If you wish, follow this link and see how this function SUMIF works directly from the Microsoft source.
https://support.office.com/en-US/article/SUMIF-function-169B8C99-C05C-4483-A712-1697A653039B

Thanks for the feedback.
Happy to be able to help.

Have a nice day!
--
Belo Horizonte, Brasil.
Marcílio Lobão