excel courses, excel training

advance excel courses

The Sumif formula

Definition

This formula is a very handy formula to use. U will use this to extract figures from a big database. When you combine this with a Vlookup formula, you can really do magic with this and do reports you did in 2 weeks in 5 minutes. When you get data of hundreds or thousands of lines, you can add some figures with the same characteristics, for instance the same month, Group of accounts, same province or anything Yes, you can do this with a Pivottable, but when management expects a report in a specific format, a Pivottable will not work.

The makeup of the formula

The sumif formula consists of 3 components:

  • The range field: This is the column in which the characteristics are.

Let’s show what we mean. We have the following data.

Month

Group

Amount

Jan-08

Sales

0.01

Mei-07

Cost of Sales

0.02

Aug-07

Sales

0.02

Sep-07

Cost of Sales

0.02

Sep-07

Sales

0.16

Jan-08

Cost of Sales

33.22

Feb-08

Sales

33.22

Feb-08

Cost of Sales

56.00

Feb-08

Sales

56.00

Jun-07

Cost of Sales

68.72

Sep-07

Sales

80.00

Jan-08

Cost of Sales

96.00

Mei-07

Sales

107.45

Nov-07

Cost of Sales

126.10

Nov-07

Sales

126.10

Mei-07

Cost of Sales

134.60

Mei-07

Sales

134.60

Jun-07

Cost of Sales

134.60

Aug-07

Sales

140.00

Aug-07

Cost of Sales

140.00

Aug-07

Sales

140.00

Aug-07

Cost of Sales

140.00

Apr-07

Sales

141.40

Nov-07

Cost of Sales

145.90

Feb-08

Sales

152.00

Okt-07

Cost of Sales

155.40

Mar-07

Sales

166.67

Mar-07

Cost of Sales

166.67

Mar-07

Sales

167.27

Mar-07

Cost of Sales

175.00

Apr-07

Sales

200.00

Mei-07

Cost of Sales

200.00

Jun-07

Sales

200.00

Mar-07

Cost of Sales

200.00

Apr-07

Sales

215.58

Sep-07

Cost of Sales

220.00

Okt-07

Sales

235.40

Sep-07

Cost of Sales

237.02

Des-07

Sales

264.10

Mar-07

Cost of Sales

272.79

Nov-07

Sales

281.50

Apr-07

Cost of Sales

290.60

We have two possible range columns, the months and the groups. This is where excel must search for our criteria to total up. Now, we can do a sumif on the months which will effectively give us the gross profit per month, or we can do sales or a cost of sales total.

  • Criteria field: In this field, you will put the criteria to be summed, for instance the specific month which must be summed, or the sales or cost of sales figures.
  • Sum Range Field: Here the columns will be stated which must be totaled, which will, in the above table be the third column.

If we want the gross profit on certain months, we will do the following:

Column E

Formula

         Result

Mar-07

=SUMIF(A:A,E2,C:C)

1 148.40

Apr-07

=SUMIF(A:A,E3,C:C)

847.58

Mei-07

=SUMIF(A:A,E4,C:C)

576.67

Jun-07

=SUMIF(A:A,E5,C:C)

403.32

Aug-07

=SUMIF(A:A,E6,C:C)

560.02

sumif

If we want the sales and Cost of Sales figures, we will do the following:

Column E

Formula

           Result

Sales

=SUMIF(B:B,E9,C:C)

2 841.48

Cost of Sales

=SUMIF(B:B,E10,C:C)

2 992.66

The nice thing about sumif is that if there is no data found, then the answer would be zero not an error.

Using the vlookup formula and the sumif formula together

So how can we use this with a Vlookup? If we have account codes or names that stay the same every month we can use a Vlookup to always allocate the codes correctly. We can then put in an allocation sheet, to allocate this group to certain other groups like follows:

Account Code

Allocation

ADMIN FEE

Expenses

ADVERTISING

Expenses

ADVERTISING & PROMOTIONS

Expenses

AMORTISATION GOODWILL

Expenses

AUDIT FEES - AUDIT

Expenses

BANK CHARGES

Expenses

Entertainment, legal, telephone and postage can be allocated to “Expenses” for instance. If we have our data, we can do a Vlookup to our allocation sheet to tell excel what the new group is.

Example

Our system can make the following download into excel

System Code

System Description

Amount

0001/000

 Meat

-3 525.00

0002/000

 Eggs

-268 393.00

0004/000

 Bags

-3 482 402.00

0005/000

 Files

27 124.00

0113/000

 Stationary

757 395.00

0115/000

 FUEL

383 053.00

0115/001

 Diesel

83 393.00

 0289/005

 Partner Interest Paid

835 035.00

 0289/006

 Lease Interest

38 539.00

 0289/008

 Bank Interest

-358 539.00

 0322/001

 Loose Tools

357 302.00

 0325/000

 Licenses & Permits

464 758.00

This may seem like little data but remember some companies may have thousand of lines per month like this one.
So we have a standard management report that look like follows:

Monthly Report

 

 

Sales

 

Cost of Sales

 

 

 

Gross Profit

0.00

 

 

Sundry Income

 

Operating Expenses

 

 

 

PBIT

0.00

 

 

Interest

 

 

 

Net Profit

0.00

We can redo the report every month, or use a combination of sumif and Vlookup formula and automate the process.
First we need to allocate our code to something by using Vlookup.
We need to create another sheet and only copy the code and description there (if you want to easily know what codes there are, use a Pivottable)
Then we must only write the description of the group in which they fit in next to them (it’s easier to write the same names of groups that are the same as your report, like “sales”, or “operating expenses”)

This sheet will look like follows then:

System Code

System Description

New Allocation Group

0001/000

 Meat

Sales

0002/000

 Eggs

Sales

0004/000

 Bags

Sales

0005/000

 Files

Cost of Sales

0113/000

 Stationary

Sales

0115/000

 FUEL

Operating Expenses

0115/001

 Diesel

Operating Expenses

 0289/005

 Partner Interest Paid

Interest

 0289/006

 Lease Interest

Interest

 0289/008

 Bank Interest

Interest

 0322/001

 Loose Tools

Cost of Sales

 0325/000

 Licenses & Permits

Operating Expenses

Now, we must do a Vlookup in our download to tell excel to which group each amount belongs. Like follows:

System Code

System Description

Amount

Formula

Result

0001/000

 Meat

-3 525.00

=VLOOKUP(A2,Allocations!A:C,3,FALSE)

Sales

0002/000

 Eggs

-268 393.00

=VLOOKUP(A3,Allocations!A:C,3,FALSE)

Sales

0004/000

 Bags

-3 482 402.00

=VLOOKUP(A4,Allocations!A:C,3,FALSE)

Sales

0005/000

 Files

27 124.00

=VLOOKUP(A5,Allocations!A:C,3,FALSE)

Cost of Sales

0113/000

 Stationary

757 395.00

=VLOOKUP(A6,Allocations!A:C,3,FALSE)

Sales

0115/000

 FUEL

383 053.00

=VLOOKUP(A7,Allocations!A:C,3,FALSE)

Operating Expenses

0115/001

 Diesel

83 393.00

=VLOOKUP(A8,Allocations!A:C,3,FALSE)

Operating Expenses

 0289/005

 Partner Interest Paid

835 035.00

=VLOOKUP(A9,Allocations!A:C,3,FALSE)

Interest

 0289/006

 Lease Interest

38 539.00

=VLOOKUP(A10,Allocations!A:C,3,FALSE)

Interest

 0289/008

 Bank Interest

-358 539.00

=VLOOKUP(A11,Allocations!A:C,3,FALSE)

Interest

 0322/001

 Loose Tools

357 302.00

=VLOOKUP(A12,Allocations!A:C,3,FALSE)

Cost of Sales

 0325/000

 Licenses & Permits

464 758.00

=VLOOKUP(A13,Allocations!A:C,3,FALSE)

Operating Expenses

We can now easily do our report by sumif formulas
Remember the 3 fields of sumif

  • First the range, will be our groups, because this is the range in which our characteristics must be found
  • Secondly our criteria is the line item in our report that must be found, like “sales” or “operating expenses”
  • The thirdly we must state which columns must be added up, this is our amount column

Our report would then automatically be generated like follows:

Monthly Report

 

 

 

 

 

Formula

Result

 

 

 

Sales

=-SUMIF('System Download'!E:E,Report!A5,'System Download'!C:C)

2 996 925.00

Cost of Sales

=-SUMIF('System Download'!E:E,Report!A6,'System Download'!C:C)

-384 426.00

 

 

 

Gross Profit

=SUM(B5:B7)

2 612 499.00

 

 

 

Sundry Income

=-SUMIF('System Download'!E:E,Report!A10,'System Download'!C:C)

0.00

Operating Expenses

=-SUMIF('System Download'!E:E,Report!A11,'System Download'!C:C)

-931 204.00

 

 

 

PBIT

=SUM(B8:B12)

1 681 295.00

 

 

 

Interest

=-SUMIF('System Download'!E:E,Report!A15,'System Download'!C:C)

-515 035.00

 

 

 

Net Profit

=SUM(B13:B16)

1 166 260.00

We will explain a detailed example later in the book. We will also explain how you can know check the figures easily with Pivottable and also easily sort out auditors queries.

Troubleshooting

The following common mistakes are always made:

  • The thing people get wrong most of the times are when they attempt to copy the formula down or to the right, then the ranges copy with this. If for example column C:C changes to column D:D, then the wrong column will be totaled. Fix this with F4
  • Remember to put the correct criteria in. If you want to total all the amounts for March and the word March has a space with it (“March “), then it does not match up exactly and will not be totaled.
  • Make sure the range in criteria field is the same length and starts in the same row, as the range in your total field. This may cause some problems.

If you put a formula in the middle criteria field, make sure to close the brackets.

Things you can do with the sumif formula

  • Do monthly reporting without changing the format...contact us for more info
  • Use the sumif formula in combination with the concatenate formula to sum with more categories...contact us for more info

<-----Back to index

Next topic----->

 

 

 

 

 

Home | Testimonials | Terms & Conditions | Contact Us | Courses | Manuals | Sitemap | Articles |