Solved

# Equation assistance

Posted on 2013-06-04
Medium Priority
227 Views
Hi guys,

Please have a look at the attached spreadsheet. I need an equation to calculate the root product code. As you can see from the red text, if there are a group of identical product names(this could be due to varying sizes) I want them all to have the product code of the first product name in that group. I hope this makes sense?

Many Thanks,
Dean
0
Question by:deanlee17
• 2
• 2
• 2

LVL 7

Expert Comment

ID: 39218331
You could use the formula:
=IF(B2=B1,J1,J2)
in cell Sheet2:J2

Then replicate it downwards.

Essentially it says - if this row is the same as the one above, use that code, otherwise use my code.
It does require the similar codes to be in adjacent rows.
0

LVL 24

Accepted Solution

Steve earned 1000 total points
ID: 39218332
try this in J2 copied down :
=IF(COUNTIF(B\$1:B1,B2)>0,VLOOKUP(B2,B\$1:J1,9,FALSE),A2)

This will allow for Product names to be non-sequential.
0

LVL 7

Assisted Solution

Beneford earned 1000 total points
ID: 39218342
Sorry, formula correction.

=IF(B2=B1,J1,A2)
0

Author Comment

ID: 39218434
Wow 2 great answers, both worked fine. Shud i award points for first correct answer or split?...

Also, if it outside of the scope of capabilities to (for example) look up the product name online and populate a cell with the results?
0

LVL 24

Expert Comment

ID: 39218484
To look up online would require some VBA and then it all gets a tad more complicated.

It is possible to populate a "master" list and refer to this, ut then the master list would need to be updated and maintained.

As for points, it is up to you, either solution is suitable...
one simple solution which requires the list in order.
one slightly less simple, but which does not require sorting.
I think both have their merrits.
Any points are always welcome and a 50/50 split is normally quite fair if you feel that both solutions are equaly suitable.
0

Author Comment

ID: 39218495
Ok I will look into this, I feel a 50 / 50 split is fair. Thanks guys.
0

## Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.