KlayontKress
Board Regular
- Joined
- Jan 20, 2016
- Messages
- 67
- Office Version
- 2016
- Platform
- Windows
To all,
I am looking for a way to count multiple instances of a particular string in a cell over a range. I have found a way to count if a single string of characters is in a cell in a range but I'm having trouble counting multiple instances of the same string in a single cell in a range. I found a formula to count multiple instances in a single cell only, but this would require a formula next to each entry in the column to parse this data and then summing those values up. this isn't necessarily a deal breaker if I had just a few strings to look up but I will have several dozen strings to parse and having tens or hundreds of thousands of formulas trying to calculate this would be taxing on excel. I will have thousands of lines of data in the end sheet that is tied to a refresh-able report tied to a data cube.
What I'm trying to do is query results from an audit in which the auditor uses specific codes: 1A, 2A, 3A, Etc. to denote that a particular issue has been found. The data is coming from proprietary software that has "tasks" that get created for an audit, are assigned to a particular individual, and allow for the auditor to put information in an instructions field. I want to query these particular fields to parse that information out so that we can work on training the individuals based on their weak areas. It's possible for a task to have text in the following format: 1A2A1A3A5G6E1A2D3F. If I reorder that and space it apart to make it easier to read, it's: 1A 1A 1A 2A 2D 3A 3F 5G 6E.
What I currently have created is a table with formulas to parse out who the task is assigned to and the 1A, 2A, 3A, etc. codes. This works, but it's only finding single instances in a particular cell but it works over an entire range (I can search the entire columns the data is in). The formula will find the first instance of each string (1A, 2A, 3A, etc.) but not multiple instances of a single string such as 1A 1A 1A.The formula I use to do this is:
=COUNTIFS($Y:$Y,"*"&$A3&"*",$W:$W,B$2)
Where:
A3 is the code we want to query
B2 is the individual we want to query
Column Y has the Codes to be queried from the pivot table
Column W has the Names to be queried from the pivot table
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[TD]M
[/TD]
[TD]N
[/TD]
[TD]O
[/TD]
[TD]P
[/TD]
[TD]Q
[/TD]
[TD]R
[/TD]
[TD]S
[/TD]
[TD]T
[/TD]
[TD]U
[/TD]
[TD]V
[/TD]
[TD]W
[/TD]
[TD]X
[/TD]
[TD]Y
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Issue Code
[/TD]
[TD]Jenny
[/TD]
[TD]Bob
[/TD]
[TD]Lauren
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]pivot table starts here
[/TD]
[TD][/TD]
[TD]Assigned To:
[/TD]
[TD][/TD]
[TD]Instructions
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]1A
[/TD]
[TD]2 (Should be 3)
[/TD]
[TD][/TD]
[TD]1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Jenny
[/TD]
[TD][/TD]
[TD]1A 1A 1B 2A 2B
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]1B
[/TD]
[TD]1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Lauren
[/TD]
[TD][/TD]
[TD]1A 2A
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]1C
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][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UBSTITUTE(Y2,$A$2,"")))/LEN($A$2)) to count the multiples in Y2 but I have to have this next to each cell in the Y column and then sum it up. I then need this formula for each code to look up requiring multiple columns of thousands of formulas each to get this information. This requires a lot of time to calculate every time a change is made in excel. Is there a way to adapt this code to look at multiple instances in a particular cell over an entire range?
Any help would be greatly appreciated.
Thanks in advance,
I am looking for a way to count multiple instances of a particular string in a cell over a range. I have found a way to count if a single string of characters is in a cell in a range but I'm having trouble counting multiple instances of the same string in a single cell in a range. I found a formula to count multiple instances in a single cell only, but this would require a formula next to each entry in the column to parse this data and then summing those values up. this isn't necessarily a deal breaker if I had just a few strings to look up but I will have several dozen strings to parse and having tens or hundreds of thousands of formulas trying to calculate this would be taxing on excel. I will have thousands of lines of data in the end sheet that is tied to a refresh-able report tied to a data cube.
What I'm trying to do is query results from an audit in which the auditor uses specific codes: 1A, 2A, 3A, Etc. to denote that a particular issue has been found. The data is coming from proprietary software that has "tasks" that get created for an audit, are assigned to a particular individual, and allow for the auditor to put information in an instructions field. I want to query these particular fields to parse that information out so that we can work on training the individuals based on their weak areas. It's possible for a task to have text in the following format: 1A2A1A3A5G6E1A2D3F. If I reorder that and space it apart to make it easier to read, it's: 1A 1A 1A 2A 2D 3A 3F 5G 6E.
What I currently have created is a table with formulas to parse out who the task is assigned to and the 1A, 2A, 3A, etc. codes. This works, but it's only finding single instances in a particular cell but it works over an entire range (I can search the entire columns the data is in). The formula will find the first instance of each string (1A, 2A, 3A, etc.) but not multiple instances of a single string such as 1A 1A 1A.The formula I use to do this is:
=COUNTIFS($Y:$Y,"*"&$A3&"*",$W:$W,B$2)
Where:
A3 is the code we want to query
B2 is the individual we want to query
Column Y has the Codes to be queried from the pivot table
Column W has the Names to be queried from the pivot table
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/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]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Lauren
[/TD]
[TD][/TD]
[TD]2A
[/TD]
[/TR]
</tbody>[/TABLE]
I can use =((LEN(Y2)-LEN(SUBSTITUTE(Y2,$A$2,"")))/LEN($A$2)) to count the multiples in Y2 but I have to have this next to each cell in the Y column and then sum it up. I then need this formula for each code to look up requiring multiple columns of thousands of formulas each to get this information. This requires a lot of time to calculate every time a change is made in excel. Is there a way to adapt this code to look at multiple instances in a particular cell over an entire range?
Any help would be greatly appreciated.
Thanks in advance,