Which function should I use? Please advise

excellearner1298

New Member
Joined
Aug 19, 2013
Messages
5
Hello, I am relatively new to the repertoire of functions in Excel and need your suggestions. Anything will help! I need to build this set as soon as possible.



Project: Building a dataset based on US Imports. Every product has a unique identifyer (product code).

If a product qualifies for several programs, the original data set repeats the product code along with every program. The data looks something like this:

code 1 program "a" amount$
code 1 program "b" amount$
code 2 program "a" amount$
code 2 program "c" amount$
code 3 program "a" amount$

I need a column with a variable/ code that will let me know which entry program each product used. I want a dataset that looks like this:

code 1 program "a and b" amount$
code 2 program "a and c" amount$
code 3 program "a" amount$

or something like this

code 1 2 amount$
code 2 3 amount$
code 3 1 amount$

where 1=program a, 2= program a and b, and 3= program a and c


I was considering Vlookup but don't think this will work because one code is repeated several times. The other function I was thinking about was Concatenate- "concatenate the column that lists the program name if the code is repeated" and "sum if the code is repeated".



Thank you for your help!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Difficult to understand your requirements, if you could include a screenshot with actual examples it would help alot, e.g. column and row details, actual data content etc.

If you're using Excel 2007 or later, the SUMIFs function is likely to return what you want.

SUMPRODUCT probably can too and would suggest using that if you're on Excel 2003 or earlier.
 
Upvote 0
Hello and thank you for your answer.

Here is an example of format the data is in right now

code program code
03023400

<tbody>
</tbody>
No program claimed

<tbody>
</tbody>
03033901

<tbody>
</tbody>
Andean Act (ATPA)

<tbody>
</tbody>

<tbody>
</tbody>
03033901

<tbody>
</tbody>
GSP
07108070

<tbody>
</tbody>
Andean Act (ATPA)

<tbody>
</tbody>
07108070

<tbody>
</tbody>
GSP
07102120

<tbody>
</tbody>
GSP

<tbody>
</tbody>


This is what I want

code program code
03023400

<tbody>
</tbody>
No program claimed

<tbody>
</tbody>
03033901

<tbody>
</tbody>
Andean Act (ATPA) & GSP

<tbody>
</tbody>

<tbody>
</tbody>
07108070

<tbody>
</tbody>
Andean Act (ATPA) & GSP

<tbody>
</tbody>
07102120

<tbody>
</tbody>
GSP

<tbody>
</tbody>


Once I have this set up I will use v look up get the amount from another set. I am sorry if the last idea in my post was confusing. I meant to convey that I don't need the programs to be spelled out, I mentioned this because working with string text might present difficulties. If it is easier to work with a code, as opposed to the program name, I have no problem doing that.

thank you very much for your advice
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,780
Members
449,049
Latest member
greyangel23

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