SUMPRODUCT help!

tarantula

New Member
Joined
May 6, 2010
Messages
17
I made a thread month ago to which I received great help.

My original question was:

I have three columns of data I need to analyse, and report that in another column.

Column headers are:
A | B | C
New Business? | Company Name | Sales Area

With data as such:

Yes | Acme Ltd | D

The yes can also be a no, company name obviously a range of names, and sales area a-m.

The result I'm going for is to have a COUNT of new business sales, per area. So looking, for example, for all the New Business: YES's, in Sales Area: D.

Now to complicate that some business names (and the sales area and new business y/n) are going to be the same, as it's recorded against which products they've bought so there could be several rows for each business name.

I need to remove the duplicate business names from the results.

This is the best calculation I have got this far!

jasonb75 said:
A | B | C | D
New Business? | Company Name | Sales Area | Helper

Assuming you have headers in A1:C1 and actual data starts in A2

In D2 enter = countif(B$2:B2,B2) then fill it down the column to the end of your data range.

Then in a new results table, anter the sales areas in the first column. (Z2 in formula below is cell with first sales area ref)

Your result formula would then be =SUMPRODUCT((A:A="Yes")*(D:D=1)*(C:C=Z2))

Jason tweaked this slightly and we ended with the result:


Try this for helper column formula filled down as before

=SUMPRODUCT((A$2:A2="yes")*(B$2:B2=B2)*(A2="yes"))

And for your result table formula.

=SUMPRODUCT((C:C=Z2)*(D:D=1))

This method will only count rows with Yes in column A

Now I've just found a fault although it is a small oversight and I'm sure easily remedied, I'm unable to work it out!

I've noticed that we have companies buying products in multiple sales areas, so I need to make sure I get a '1' for the first instance of each sale per area, at the moment I get:

Barns ltd | Yes | A | 1
Barns ltd | Yes | B | 2
Barns ltd | Yes | A | 3

But need:

Barns ltd | Yes | A | 1
Barns ltd | Yes | B | 1
Barns ltd | Yes | A | 2


Anybody shed any light?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I think another helper column where we can concatenate the 3 columns.

=concatenate(A1,B1,C1). Fill this formula down to your data, Say this is in column E.

In column D or where you want the count, Do a countif on our newly created helper column.

=COUNTIF($E$2:E2,E2). You can fill this formula down to your data again. This will show the instance your data repeats.

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,246
Members
449,075
Latest member
staticfluids

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