Populating Cells with data from different area

Copper Contributor

So forgive me if this doesn't make sense, I am not sure exactly how to explain what I want to do. Basically this file is used to track transfers between departments, what we do is input each transfer into worksheet #2 (one line per item transferred) as we go through the month. For each line on worksheet #2 we input the Dept ID which populates the department description (using the lookup function but has no purpose for our purposes here), we input the inventory number, the number of transaction is always going to be 1 and the cost.

 

So the next part of this is to get the subtotals from each department in worksheet 2 inputted onto worksheet 1. There are too many departments to give them each their own section (which would greatly simplify this process) so what I want to do if possible is to make the cells in worksheet 1 recognize the dept id's in worksheet 2 and populate the subtotal in the correct departments on worksheet 1.

 

So in my examples below there are 2 transfers from Alpha listed on worksheet 2, right now I would have to sort and filter by department to gather the data I need for sheet 1. What I want is a formula that can be placed on sheet one that can read the dept id's and place the totaled amount into the correct field.

 

So Worksheet 1 will look like this:

Code #Department NameJ AcquisitionJD DisposalNumber of Transactions
A1ALPHA 45.002
B2BETA

20.00

 1
C3GAMMA25.00 1

 

Worksheet 2 looks like this

Transfer From    Transfer To     
Dept   Number of
Transactions
  Dept   Number of
Transactions
   
CodeDepartmentAsset NoCost CodeDepartmentAsset NoCost  
A1ALPHAXXXX120.00 B2BETAXXXX120.00  
A1ALPHAOOOO125.00 C3GAMMAOOOO125.00  
             
   245.00    245.00  

 

I hope this makes sense, if not let me know and I will try to explain myself better. 

5 Replies

@kerry590 

 

Do you have an actual workbook already going? It would be a lot easier to show you how to do this with that actual, rather than re-creating from your example. So long as there's no proprietary info on it (or private info) you can post it here.

Try this, I do not think there is any proprietary info but I have change dept names for simplicity. @mathetes 

@kerry590 

 

I think the SUMIF function is the one you need. That's what I've used in the attached, and it seems to be producing the right results.

Works like a charm! My next question would be how can I make it show a blank cell if it is empty rather than a zero?@mathetes 

@kerry590 

 

You can accomplish that under your Preferences, in the View section. You have the choice of showing zero values or not. Just "unselect" that box.

mathetes_0-1598652243049.png