IF statement - [Solved/Closed]

Report
-
Posts
1852
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
November 7, 2020
-
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

3 replies

Posts
1852
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
November 7, 2020
136
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
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
Posts
1852
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
November 7, 2020
136
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

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!