Sumif that does two things

south0085

Board Regular
Joined
Aug 15, 2011
Messages
141
I'm using Excel 2010.

I have some line at the top of my spreadsheet that show the item number (purchases), the item description, the quantity we need, taxable or not taxable, the cost of the item, and lastly the total.

At the bottom I have a line for freight (manually entered) and a line for tax.

My sumif formula says that if you see any lines above that are taxable ("T"), total them and multiply by 6%.

But I need to add to that same formula, this: If any of those line are in fact taxable, then ALSO look at the freight line and calculate that tax and add it here in this cell.

But if there are no taxable lines above, then don't calculate tax on the freight.

Basically what I'm saying is. I don't ONLY want to calculate tax on the lines above. But I also want to add the tax of the freight (if there are any taxable items above).

Here's what my sheet looks like. I can send this to anyone via attachment if you'd like:

Thank you so much for your help!

Excel Workbook
ABCDEFGHIJ
3**********
4Date*Supplier No.S500017*
5Name*SupplierA & A MACHANICAL SERVICE INC*
6Signature*AddressLOUISVILLE, KY****
7Dept4100ACCOUNTING/ITRequested Delivery Date**
8CCR No.****
9Request*****
10**********
11PURPOSE*****
12****Order CurrencyJPY
13**********
14AccountCodeAccountGroupClassCodeItem No.DescriptionQuantityUnitMeasureTaxNo TaxUnitPriceSubtotal
1580060COGS Travel Expense41004511*1kgT100.00100.00
1680060COGS Travel Expense41004511*1kgNT200.00200.00
1780060COGS Travel Expense41004511*1kgT300.00300.00
1880060COGS Travel Expense41004511*1kgNT400.00400.00
1980060COGS Travel Expense41004511*1kgNT500.00500.00
2080060COGS Travel Expense41004511*1kgT600.00600.00
2180060COGS Travel Expense41004511*1kgNT700.00700.00
22---****NT*0.00
23---****NT*0.00
24---****NT*0.00
25*****TOTAL before Tax & Freight**JPY2,800.00
26$ * * * * *1,000.00****Freight Cost (Taxable if Item is)**JPY20.00
27*****Tax6%TJPY60.00
28* Quotation(s) or Invoice(s) must be attached to be approved.****GRAND TOTAL**JPY2,880.00
29*****Estimated Cost in USD*120.48USD23.90
Purchase Requisition Form
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try something like this. Freight_Cost is pretax

=SUMIF($H$15:$H$24,"T",$J$15:$J$24) + (Freight_Cost * (1 + IF(COUNTIF($H$15:$H$24,"T"),6%, 0)))
 
Upvote 0
Try something like this. Freight_Cost is pretax

=SUMIF($H$15:$H$24,"T",$J$15:$J$24) + (Freight_Cost * (1 + IF(COUNTIF($H$15:$H$24,"T"),6%, 0)))

Thank you, Alphafrog!

I modified it slightly to this:

'=SUMIF($H$15:$H$24,"T",$J$15:$J$24)*6%+(J26*(IF(COUNTIF($H$15:$H$24,"T"),6%,0)))

I didn't need the "1+" since I only want to add the tax, not the freight AND the tax.

But I needed the jump start. Thanks for the formula idea. Big help.
 
Upvote 0
You're welcome. Thanks for the feedback and glad you worked it out.

Alternatively:
'=(SUMIF($H$15:$H$24,"T",$J$15:$J$24)+IF(COUNTIF($H$15:$H$24,"T"),J26,0))*6%
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,360
Messages
6,124,491
Members
449,166
Latest member
hokjock

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