# Formula question

#### elpresidente

##### New Member
I'm racking my brain trying to figure out a formula that will perform the following: I have expense/income codes set up for my business such as fuel is code 10, labor is code 20, deposits are code 50 and so on. Let's say cell A2 has a 10(for fuel code) in it and B2 has a dollar amount that reflects A2. I need a formula that will find all 10's and sum the corresponding cells that reflect the dollar amounts. I'm sure it's a simple formula but I need some help. I'm comfortable with Excel but a formula rookie. Thanks in advance and if I get rich I'll send you a consulting fee!

### Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

#### Anne Troy

##### MrExcel MVP
=sumif(a2:a2000,"=10",b2:b2000)

So:

first part is range where condition lies
second is condition
third is what cells to add if condition is true

#### plettieri

##### Well-known Member
Hello elpresidente
Welcome to the Board!

Several ways to get what your are looking for....one way using the consolidate technique Data | Consolidate | set your range ok

other methods ....pivot table....=SUMIF

using the wizards should give you some help

hope this helps

pll
test89.xls
EFGH
13codedescripamount
1410fuel55
1520labor88
1610fuel66
1720labor45
19
20
21descripamount
2210121
2320133
24401200
25
26
Sheet2

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,167,943
Messages
5,856,432
Members
431,813
Latest member
seconduser

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back