Report

IF statement - [Solved]

Ask a question Le0n2 - Last answered on Feb 16, 2017 at 01:25 PM by Mazzaropi
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
Helpful
+0
plus moins
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
Leave a comment
Helpful
+0
plus moins
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
Leave a comment
Helpful
+0
plus moins
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
Leave a comment

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!