Category sum up

Aberdham

Board Regular
Joined
Mar 8, 2018
Messages
163
Office Version
  1. 365
Platform
  1. Windows
Hi Excel Gurus,

I am currently trying to sort out the total net Revenue within my Invoice workbook.

Here is how it Looks like :

I have 3 different types of invoices:

- AR-XXX
- AP-XXX
- MA-XXX

They are all mixed together. Now I would like to find out the sum of each catories.

could any of you please write a VBA code to resolve this issue?

Hope to hear from you soon !
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
not sure if pivot table would work since there isn't any indication of which type of invoice they belong to.

in case of SUMIF, do you then need separate formula for the respective type? not sure of how SUMPRODUCT works...?

:eeek:
 
Upvote 0
Hi,

Here's a sample of how a SUMPRODUCT solution would be, same formula for all Invoice types:


Book1
ABCDE
1Invoice AmtCategoryTotal
2AR-123$111.00AR555
3AP-234$222.00AP777
4MA-345$333.00MA999
5AR-456$444.00
6AP-567$555.00
7MA-678$666.00
Sheet17
Cell Formulas
RangeFormula
E2=SUMPRODUCT((LEFT(A$2:A$7,2)=D2)*(B$2:B$7))


E2 formula copied down.
 
Upvote 0
[TABLE="width: 488"]
<tbody>[TR]
[TD]Invoice No.
AP000424[/TD]
[TD] Amount
$ 550,00 [/TD]
[TD][/TD]
[TD]Category
AR[/TD]
[/TR]
[TR]
[TD]AR000222[/TD]
[TD] $ 646,50 [/TD]
[TD][/TD]
[TD]AP[/TD]
[/TR]
[TR]
[TD]AP000513[/TD]
[TD] $ 12.000,00 [/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col><col span="2"></colgroup>[/TABLE]



=sumproduct((left(D$1588:D$1673,4)=AH1588)*(G$1588:G$1673)

I have tried the formula, how come it doesn't work? am i getting it wrong somehow?

please let me know thanks !
 
Upvote 0
[TABLE="width: 488"]
<tbody>[TR]
[TD]Invoice No.
AP000424[/TD]
[TD] Amount
$ 550,00[/TD]
[TD][/TD]
[TD]Category
AR[/TD]
[/TR]
[TR]
[TD]AR000222[/TD]
[TD] $ 646,50[/TD]
[TD][/TD]
[TD]AP[/TD]
[/TR]
[TR]
[TD]AP000513[/TD]
[TD] $ 12.000,00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]



=sumproduct((left(D$1588:D$1673,4)=AH1588)*(G$1588:G$1673)

I have tried the formula, how come it doesn't work? am i getting it wrong somehow?

please let me know thanks !

Change the 4 to 2
 
Upvote 0
I did the same and change the 4 to 2, it says my formula contains an error. I am wondering if the Category type needs to be the exact match instead of just the 2 letters from the beginning ?
 
Upvote 0
If it says "your formula contains an error" then youve typed it in wrong.
If the formula is returning an error such as #VALUE then column G contains text and should only contain numbers
 
Upvote 0
I literally copy paste the formula... could you please check where it goes wrong ?
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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