Counting number of invoices in a batch & getting an autosum of the total amount of the same batch

Betty Woo

New Member
Joined
Jan 19, 2007
Messages
16
H'oh, boy.

In my valiant attempts to try to make my team do as little actual entry as possible and because we currently seem to have a habit of having multiple records inputters who don't know our system very well, I've been trying to automate our Batch Log as much as possible to reduce errors and confusion. I've got drop down lists and VLOOKUPs whenever possible and that will reduce errors but I'd like even more automation.

But first, a few caveats: we work in XP with Excel 2000 (I know:::sigh::: ). We can not download or install any add-ons on our machines without IT's permission... and they're not ever going to give it.

OK. Now, as you can deduce from the expandable image below, we receive batches of invoices that we process to eventual payment. The batches are given a number based on the Fiscal Year Period+sequence number and we never know how many batch numbers will be used in any given Period or how many invoices will be included under any one batch number.

This Batch Log is our record. Immediately after entering the information for the batch, we go on to use the information in Oracle and process the batches for payment and then send the physical batches up to our Finance Department for possible audit.

1. What I'm trying to do is to figure out how to get D4 to count how many instances a singular batch # will appear in column 'B' and just record that number. And then for every other singular batch number that will eventually be inputted into column 'B'.

I don't really care if the calculated number appears in 'D' on all the rows with the same batch #, if that makes things easier. This'll cut down on possible discrepancies between what we've recorded originally and what we processed through Oracle in case an invoice is pulled from the batch but the pull is not properly reflected in the batch log (i.e. someone pulls John Davis' $20.00 invoice but doesn't alter the # of Invoices or Total Amount of Invoices columns).

2. Another thing Oracle will require is the total cost amount of invoices per Batch #. Yeah... seems some of our team aren't too good at hitting all the right number keys on their calculators and we've had some batches be off. I'd like to be able to blame Excel from now on if the totals don't match :)

This one's a little tricky since I'd prefer finding a way where the total only appears in the first cell of the Batch # sequence (in case we may play with AutoSum-ming in the future). If that's too much to hope for, then we'll just live with multiple entries.

I thought of the COUNT functions but so many examples seem dependent on dates that it's hard to figure out how to do a simple count of a number in a dynamic range without having to define that number in the formula itself.

Any guidance would be appreciated in this 'cause at this point I'm flummoxed. Help?

B.W.


 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi,

In D4 and copied down,

=if(countif($b$4:$b$1000,b4)=1,countif($b$4:$b$1000,b4),"")

In E4 and copied down,

=if(d4<>"",sumif($b$4:$b$1000,b4,$i$4:$i$1000),"")

HTH
 
Upvote 0
Thank you, Kris!

This will work very well, indeed. And now, no more excuses for miscalculations (unless, of course, the inputter forgets to update D4 - '# of invoices')!

This is most welcome. Many thanks for providing this. I'm going to have to sit down one day soon and analyze the answer so I know exactly that is happening within it. Once I do that, maybe I can use it on some other side-projects I'm looking at doing. One day. When I have time... .

I'm going to post another question in another thread re: this spreadsheet re: transferring a couple of column entries onto Sheet 2 only *if* the invoice is a 'Travel Claim - immediate'.

I figure if I can do that, I've eliminated over half the times an inputter has to do repeat entries of the same data onto Sheet 2 - and that means saving over half the time to do this whole task. Wouldn't that be wonderful.

My ultimate is is to make things happen so smoothly and automatically (when possible) that our team's stress levels go down and we can actually have the time to get bored. Wouldn't that be an accomplishment :)
 
Upvote 0
Hi,

In D4 and copied down,

=if(countif($b$4:$b$1000,b4)=1,countif($b$4:$b$1000,b4),"")

In E4 and copied down,

=if(d4<>"",sumif($b$4:$b$1000,b4,$i$4:$i$1000),"")

HTH

What is D4's code suppose to do?

It's not actually counting the number of rows with the same Batch # in column B. I'm manually adding the number myself by simply looking at column B when I finish entering and putting it directly into B4's cell. *Then* it triggers E4's calculations.

But is D4 suppose to automatically count the number of rows with the same Batch #?

I'm a bit confused about this part :)
 
Upvote 0

Forum statistics

Threads
1,215,072
Messages
6,122,968
Members
449,095
Latest member
Mr Hughes

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