Count if unique and tag, else create new tag based on criteria

darrylbster

New Member
Joined
Aug 8, 2016
Messages
42
Good afternoon Guru's, I've a question for you all.

First, some history. I was here years ago to get some assistance with an offset code that had me spun, it took someone minutes to figure it out and it began journey down excel lane. Years later I am still not strong with complex formula string, but I have been able to come up with soe very useful itilities for the workplace. Until this one.

Currently I am trying to write a formula that will generate tags for a list of parts, the tags must be associated to the part size, parts with the same size must be assigned the same tag.
Try and try as I might, I can't get this to work, I simply don't have the experience or knowlege base, but this one final formula is the verry on top of an excelent tool for my company.

Lets paint a picture.


<tbody>
The column I need to solve for is 'Tag'. As is stands I have a complex spreadsheet to be used as both order assembly and order cross check, but if the originator of the workbook is not diligent with his tagging, we can end up with the same part being assigned different tags, easily done over the course of hundreds of parts.

What I need is a formula that will evaluate the data in width and height, check it against part, then check all parts above for the unique combination of Width and height. If the comnination is found, it assigns the take associated with that combination, if it's unique it has to ecaluate the highest level of tagging for that part and add 1.

I've had elements of the evaluation working, but never together, and often with errors. This solution is beyond me.

Thanks.

<tbody>
Part
WidthHeightTag
A
x
y
A-1
A
y
z
A-2
B
z
y
B-1
B
x
y
B-2
A
y
z
A-2
C
z
y
C-1
C
z
x
C-2
B
z
y
B-1

<tbody>
</tbody>

<tbody>
</tbody>

<tbody>
</tbody>

</tbody>
</tbody>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Something like this?


Excel 2010
AB
1PartNumber
2QQ1
3QQ1
4QQ1
5WW2
6EE3
7EE3
8EE3
9EE3
10EE3
11EE3
12RR4
13RR4
14RR4
15RR4
16RR4
17TT5
18YY6
19UU7
20UU7
21UU7
Sheet12
Cell Formulas
RangeFormula
B2=IF(A2=A1,B1,IF(ISNUMBER(B1),B1,0)+1)
 
Upvote 0
It would seem that about half of my post was eliminated somehow...

I'm trying to create a tagging convention but I can't get any of the functions to work properly, or together.

Part TypeWidthHeightTAG
AZYA-1
AXZA-2
AXYA-3
BZXB-1
BZYB-2
AXZA-2
CXYC-1
BZXB-1

<tbody>
</tbody>


What I'm trying to do is create a formula that will check the combination of Width and Height against part type associated. If at any point that unique combination of width and height is associated witht he same part type, it will return the assocaited tag, if the unique combination does not exist it must check for the maximum value of TAG and add 1. The kicker is that this can't be done with a macro because the evaluation must be live, we take this TAG and apply it to our drawings as we are creating. Also note that the TAG is derived from the part type.

There was a time when I thought I'd figured this one out, but I cound never get it to evaluate more than one combination.

Thanks everyone, this is probably like a childs question to some of you.
 
Upvote 0
blueredgreen
size1size2size3
part1blue1red1green1
part2red2green2
part3blue2
part4red3
part5green3
is this what you mean ?
note part2 is not manufactured in size1

<colgroup><col width="64" span="9" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
blueredgreen
size1size2size3
part1blue1red1green1
part2red2green2
part3blue2
part4red3
part5green3
is this what you mean ?
note part2 is not manufactured in size1

<tbody>
</tbody>

. My first post was cut off and it makes my question hard to read. I've contacted the admin to correct my first post, but in the mean see post 3.
Not quite
 
Upvote 0
There's better but this worked on an extended sample, test it some more and tell me if there are any breaks:


Excel 2010
ABCDE
1Part TypeWidthHeightTAG
2AZYA-11
3AXZA-22
4AXYA-33
5BZXB-11
6BZYB-22
7AXZA-22
8CXYC-11
9BZXB-11
10AXZA-22
11AXLA-44
12CXYC-11
13AZJA-55
14AXZA-22
15BRLB-33
16DGKD-11
17BQWB-44
Sheet13 (7)
Cell Formulas
RangeFormula
D2=A2&"-"&E2
E2{=IF(COUNTIFS($A$2:$A2,A2,$B$2:$B2,B2,$C$2:$C2,C2)=1,SUMPRODUCT(1/COUNTIFS($A$2:$A2,$A$2:$A2,$B$2:$B2,$B$2:$B2,$C$2:$C2,$C$2:$C2)*($A$2:$A2=A2)),INDEX($E$1:$E1,MATCH(A2&B2&C2,$A$1:$A2&$B$1:$B2&$C$1:$C2,0)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Well I can say two things about this. A) I never thought of splitting the formua like that, it works great. B) I wasn't even close.

I think for the most part I'm able to get certain things done, but any time one of you guys put it together it's far more condensed and refined.

Is there any way to get column E to display letters?
 
Upvote 0
This?


Excel 2010
ABCD
1Part TypeWidthHeightTAG
2AZYA-1
3AXZA-2
4AXYA-3
5BZXB-1
6BZYB-2
7AXZA-2
8CXYC-1
9BZXB-1
10AXZA-2
11AXLA-4
12CXYC-1
13AZJA-5
14AXZA-2
15BRLB-3
16DGKD-1
17BQWB-4
18ABCA-6
Sheet13 (8)
Cell Formulas
RangeFormula
D2{=IF(COUNTIFS($A$2:$A2,A2,$B$2:$B2,B2,$C$2:$C2,C2)=1,A2&"-"&SUMPRODUCT(1/COUNTIFS($A$2:$A2,$A$2:$A2,$B$2:$B2,$B$2:$B2,$C$2:$C2,$C$2:$C2)*($A$2:$A2=A2)),INDEX($E$1:$E1,MATCH(A2&B2&C2,$A$1:$A2&$B$1:$B2&$C$1:$C2,0)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Sorry, I think I've crossed some lines here. The first solution worked great, no issues with function at all, the second is an improvement on that for sure. What I was asking was weather or not column e could generate sequencual letters as opposed to numbers, creating an A-A tag rather than an A-1 tag.

Thanks so much fo the help, I was so off based with my attempts.
 
Upvote 0
Something like:


Excel 2010
ABCD
1Part TypeWidthHeightTAG
2AZYA-A
3AXZA-B
4AXYA-C
5BZXB-A
6BZYB-B
7AXZA-B
8CXYC-A
9BZXB-A
10AXZA-B
11AXLA-D
12CXYC-A
13AZJA-E
14AXZA-B
15BRLB-C
16DGKD-A
17BQWB-D
18ABCA-F
19BTQB-E
20ENQE-A
21DNND-B
22DGKD-A
Sheet13 (8)
Cell Formulas
RangeFormula
D2{=IF(COUNTIFS($A$2:$A2,A2,$B$2:$B2,B2,$C$2:$C2,C2)=1,A2&"-"&CHAR(64+SUMPRODUCT(1/COUNTIFS($A$2:$A2,$A$2:$A2,$B$2:$B2,$B$2:$B2,$C$2:$C2,$C$2:$C2)*($A$2:$A2=A2))),INDEX($D$1:$D1,MATCH(A2&B2&C2,$A$1:$A2&$B$1:$B2&$C$1:$C2,0)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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