Count Of Locations Using Items

Nanogirl21

Active Member
Joined
Nov 19, 2013
Messages
330
Office Version
  1. 365
Platform
  1. Windows
I am looking to count what locations are using a specific item. I am not sure the best way to do this based on how my data is generated from an external source. I don't like adding sheets/columns if needed. Any suggestions?

CURRENT SET UP
SHEET 1
COL A= Locations (70,000 rows, but only 10 unique values)
COL B = Items used formated as ["Apples","Bananas","Mushrooms"]. There can be up to 30 items listed

SHEET 2
COL A= list of 58 items that can be used.

RESULTS WANTED
SHEET 3
COL A = Same list of 58 items from SHEET 2 COL A
COL B = Location 1 using item in COL A
COL C = Location 2 using item in COL A
COL D = Location 3 using item in COL A
continue same format to COL K that would be Location 10.
**Not all items will have all 10 locations, but all will have at least 1 location
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
In sheet3 A2 copied down
=Sheet2!A2
B1 copied across
=IFERROR(INDEX(Sheet1!$A2:$A32,MATCH(0,INDEX(COUNTIF($A$1:A1,Sheet1!$A2:$A32),0),0)),"")
B2 copied down & across
=COUNTIFS(Sheet1!$A$2:$A$64,B$1,Sheet1!$B$2:$B$64,"*"&$A2&"*")
 
Upvote 0
In sheet3 A2 copied down
=Sheet2!A2
B1 copied across
=IFERROR(INDEX(Sheet1!$A2:$A32,MATCH(0,INDEX(COUNTIF($A$1:A1,Sheet1!$A2:$A32),0),0)),"")
B2 copied down & across
=COUNTIFS(Sheet1!$A$2:$A$64,B$1,Sheet1!$B$2:$B$64,"*"&$A2&"*")

Perfect. Thank you.
 
Upvote 0
In sheet3 A2 copied down
=Sheet2!A2
B1 copied across
=IFERROR(INDEX(Sheet1!$A2:$A32,MATCH(0,INDEX(COUNTIF($A$1:A1,Sheet1!$A2:$A32),0),0)),"")
B2 copied down & across
=COUNTIFS(Sheet1!$A$2:$A$64,B$1,Sheet1!$B$2:$B$64,"*"&$A2&"*")

Actually, I noticed that it's not counting when only 1 item is used. How would I add/modify for that? Format for 1 item is ["item"]
 
Upvote 0
Works for me.
Can you post some sample data?
 
Upvote 0
Works for me.
Can you post some sample data?


Works for me.
Can you post some sample data?

I was able to figure it out, turns out that wasn't the issue at all. The problem is if part of a item name appears in multiple items both items are counted.


Example:
ITEMS
Banana
Banana Nut

Banana and Banana Nut both is counting as 2 instead of 1 becasue Banana is in both words. I need these to be counted both as 1 even though they both contain the word Banana.
 
Upvote 0
Are the items in sheet1 wrapped in quotes, as shown in your op?
 
Upvote 0
Are the items in sheet1 wrapped in quotes, as shown in your op?

None of my items on Sheet 2 are in quotes.

Some of the items on Sheet 1 are in quotes, but not all.

Sheet 1 Examples
["Banana"]
["Banana", "Apple"]
Banana
 
Upvote 0
In that case I'm afraid I can't help any further.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

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