Excluding duplications in rows only when using countif function

OfficeMonkey666

New Member
Joined
Oct 13, 2017
Messages
2
Hi,
I will try to explain this the best that I can.
I have a dump of data every month that I have to use to create reports. This dump has columns up to NG and rows are are currently at 1112, so its a large spreadsheet. The columns will not change but the rows will get longer per month. There are various reports that run so I dont want to change the structure of any or the source data.

The report I have to run is to find out how many companies work in specific sectors, each company has its own row and within this row certain columns hold the data of which sectors the company works in.

The columns are not defined in sectors, they are defined in products in which the company will enter a product and then select a sector against this product.
The issue I am having is that a company could make 6 products that would then be used in 3 sectors so in the source data there there will be 6 columns of products and 6 columns of secors but some of these sectors will be duplicated.
If I use a countif function arcoss the rows, it will count all times the sector is mentioned which isnt what I want.

Is there a formula that will count all the sectors but remove the duplications when they are duplicated in a row only?
I will try and put an example below:

a
bc
def
g
h
i
j
1
Name
Product 1
product sector 1
match
product 2
product sector 2
match
product 3
product sector 3
match
2
Company a
brakes
CarsNo
Brakes
Vans
no
wheels
Vans
No
3
Company b
wheels
cars
yes
wheelsbikes
nobrakes
cars
no
4
company c
wheels
vans
yes
brakes
vans
yes
brakescars
yes

<tbody>
</tbody>

This is a made up version of the report as I couldnt upload but I need a formula that will make the result be:
Cars = 3
vans = 2
bikes = 1

I have no need to use the product or match columns but if im using a formula like countif I can enter the name of the sector to find.
This data is found in the middle of the spreadsheet


Sorry if this is confusing!!!

Thanks
 

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.
Hi,

try this Cntl+Shift+Enter NOT just Enter

for "cars" =SUM(IF(FREQUENCY(IF(B2:J4="cars",ROW(A2:A4)-ROW(A1)+1),ROW(A2:A4)-ROW(A1)+1),1))

change "cars" as needed
 
Upvote 0
Thank you for this, I will have to give it a try when I have access

as the sheets are big and the number of rows will change monthly, instead of doing B2:J4 and Row (A2:A4) could I just use the column and row letters so it looks in all of the text in the columns and rows?
like this?

for "cars" =SUM(IF(FREQUENCY(IF(GS:IG="cars",ROW(A:A)-ROW(A1)+1),ROW(A:A)-ROW(A1)+1),1))

as the data i need to use is in columns GS through to IG?

Thanks
 
Upvote 0

Forum statistics

Threads
1,216,216
Messages
6,129,566
Members
449,517
Latest member
Lsmich

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