Add transactions based on a matching code

chrisguk

Board Regular
Joined
Jan 10, 2011
Messages
135
I have two sheets:

Main Balance Sheet

ABC
1CodeITEM Total Transactions Based on Code
2ROSomething
3BAAnother
4DEExtra
5SEMore66

Transaction Sheet

AB
1CodeAmount
2RO10
3RO24
4SE44
5DE22
6SE12

The formula should go in The "Main Balance Sheet" Column C It should add all transactions that match the code in the main balance sheet with the code against the transactions in the Transaction sheet. For example; On the main balance sheet table The code "SE" is seen twice in the transaction sheet so it adds both corresponding values in column B on the transaction sheet which is then visible as a total in the Main balance sheet.

Problem is I dont know how to do this and I have tried many ways including SUMIF and VLOOKUP

Can someone help?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You can use sumifs like
Excel Formula:
=SUMIFS(Sheet1!B:B, Sheet1!A:A,A2)
 
Upvote 0
Solution
The formula is summing the values in sheet1 col B if the values in sheet1 col A match the values in A2 on the main balance sheet.
I used Sheet1 as I don't know the exact sheet name for the transaction sheet.
 
Upvote 0
The formula is summing the values in sheet1 col B if the values in sheet1 col A match the values in A2 on the main balance sheet.
I used Sheet1 as I don't know the exact sheet name for the transaction sheet.
Main balance sheet is sheet 1 and the transactios sheet is sheet 2
 
Upvote 0
In that case just change the sheet name in the formula.
 
Upvote 0
In that case just change the sheet name in the formula.
Im sorry you have been very helpful so far maybe I have missed something of I didnt explain myself correctly.

On the transactions sheets the items are not fixed. I will enter them accordingly when I have new entries. The value on the "Main balance sheet" column C6 = 66 this value is based on the total amount of entries that appear on the "transactions sheet" that match the code in A5 on the main balance sheet. So in the transactions sheet I see to occurrences of the code SE.
 
Upvote 0
That's exactly what the formula does, although from the data you posted SE will only = 56 not 66
 
Upvote 0
That's exactly what the formula does, although from the data you posted SE will only = 56 not 66
I actually feel dumb now because I cant get it to work: This is what I have

VBA Code:
=SUMIFS('Transaction sheet'.C2:C34;A12:A33;A2)

Transaction - Sheet1 is actually called Transaction sheet

Main balance sheet - sheet2 is actually call Main Balance sheet
 
Upvote 0
Just take the formula from post#2 & change Sheet1 to 'Transaction sheet' & change the commas to semi-colons.
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top