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>
 
Whiting out the cell wouldn't work, I was thinking backwards... Maybe this?

Part TypeWidthHeightTAG
2AZYA-A
3AXZA-B This becomes ZZ
4AXYA-C We don't want this to renumber
5BZXB-A
6BZYB-B
7AXZA-B We don't want this to renumber

<tbody>
</tbody>

Part TypeWidthHeightTAG
Adjustment
AZ
YA-A
3AXZA-B
A-D - based on next in sequence, which would be displayed when I try to make the initial adjustment.
4
AXYA-C
5BZXB-A
6BZYB-B
7AXZA-B

<tbody>
</tbody>


<tbody>
</tbody>

Part TypeWidthHeightTAG
Adjustment
2AZYA-A
3AXZA-D
A-B
4AXYA-C- Does not renumber because A-B is registered to Adjustments
5BZXB-A
6BZYB-B
7AXZA-B- I could see this trying to renumber itself though..

<tbody>
</tbody>

Part TypeWidthHeightTAG
Adjustment
2AZYA-A
3AXZA-D
A-B
4AXYA-C
5BZXB-A
6BZYB-B
7AXZA-B
8AXLA-E
- Numbering Resumes?

<tbody>
</tbody>

Not sure if this would work, I think the second instance of A-B would renumber regardless because it would become unique..
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I am working with 26 widths and 26 heights - if either is more than 26 you need to rethink this imho.....
 
Upvote 0
Can you have two new columns, one for the adjustment, and another =if(no adjustment, same as before, otherwise zz etc)?
 
Upvote 0
let us say part A is a cylinder width 0.567 and height 7.35

surely that is end of story - if drawing calls for a part A then fetch it from the stores from the box labelled part A

if a new drawing calls for a cylinder width 0.567 and height 7.35 then the draughtsman needs to check the Company parts list to see if there is an EXISTING part, and if there is he amends the drawing to say, part J

a prefix code could be A=solid cylinder, B=hollow cylinder, C=rectangle, D= sheet etc etc
 
Upvote 0
That would probably work, sounds to me like the initial tagging column would become hidden in lieu of the if statement?
 
Upvote 0
Oldbrewer:

It's actually for architectural glass, so there is absolutely no standard job to job, no company master list could ever be created.
 
Last edited:
Upvote 0
but you don't keep every possible size of glass sheet in the stores - but does glass come in say 1 mm thickness increments ? and you cut one of those to size ?
 
Upvote 0
That would probably work, sounds to me like the initial tagging column would become hidden in lieu of the if statement?

I think you need something like an if statement so it knows when to use the old tag vs the new one. So keeping the letters and numbers separate again:


Excel 2010
ABCDEFGH
1Part TypeWidthHeightTAGTAG2AdjustmentNewTAGNewTag2
2AZY1A-A
3AXZ2A-B
4AXY3A-C
5BZX1B-A
6BZY2B-B
7AXZ2A-B
8CXY1C-A
9BZX1B-A
10AXZ2A-B
11AXL4A-D
12CXY1C-A
13AZJ5A-E
14AXZ2A-B
15BRL3B-C
16DGK1D-A
17BQW4B-D
18ABC6A-F
19BTQ5B-E
20ENQ1E-A
21DNN2D-B
22DGK1D-A
Sheet13 (10)
Cell Formulas
RangeFormula
E2=A2&"-"&SUBSTITUTE(ADDRESS(1,D2,4),1,"")
D2{=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($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.


Enter the adjustment as an X, then have a max(if()) formula add one to ZZ or wherever you want to start. At least that's my first idea after looking at what you've posted above.


but you don't keep every possible size of glass sheet in the stores - but does glass come in say 1 mm thickness increments ? and you cut one of those to size ?

I was wondering that too
 
Upvote 0
but you don't keep every possible size of glass sheet in the stores - but does glass come in say 1 mm thickness increments ? and you cut one of those to size ?

Architectural glass can be complex, one unit will have several factors (eg. outboard lite thickness, laminate interlayer, argon percentage, color, films, low e coating, spacer size, spacer material, inboard lite thickness, silicone color, tempering, heat soaking, annealing, heat strengthening) that make up the first half of its tag, and this will varry job by job which is why the first part is rather generic. The -# is the variant or size of the unit, which changes often but often repeates in a single job, but never works from job to job.
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,260
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