IF statement -

Solved/Closed
Le0n2 - Updated by Le0n2 on 16/02/17 at 11:52 AM
Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 - 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

3 responses

Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 147
Feb 16, 2017 at 12:03 PM
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
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
0
Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 147
Feb 16, 2017 at 01:25 PM
Le0n2,

If you wish, follow this link and see how this function SUMIF works directly from the Microsoft source.
https://support.microsoft.com/en-us/office/sumif-function-169b8c99-c05c-4483-a712-1697a653039b?ui=en-us&rs=en-us&ad=us

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

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