Attempting to read a cell with multiple values and look up results on another sheet and return results to original sheet in a single cell.

boredfool

New Member
Joined
Jun 13, 2016
Messages
7
I shall attempt to be brief with this. Working on a project for myself and cannot figure out how to do this.
On sheet one I have a cell (C3) that I want to be able to input numbers like so, 3123, 4587, 9856 and so on. Nothing but groups of 4, sadly some of them may have a letter in it as well as the last digit like 017A. There isn't a limit to how many sets of numbers there could be in the cell, probably no more than 10 but to be safe maybe a max of 20 would be fine.
I have an inventory sheet (Sheet 2) that corresponds with these numbers (Column A), in cell D3 I would like to figure out how to have excel search for each set of 4 numbers and return the value from sheet 2 Column B and whatever row it finds the number in, into Sheet 1 D3 separated by commas or the & sign.
To make it more complicated, in cell E3 of sheet one I would like to have something be able to grab numbers from Column D on sheet 2 from the corresponding row that the group of 4 is found, and somehow have it add all of the numbers it finds there and return that value to E3 on sheet 1.
Basically sheet 1 would have Inventory numbers in C3, the names of the items in the inventory in D3 and in E3 total volume or weight of the combined items.
In my head it seems like this could work, but my slow learning of VBA and functions in Excel haven't yielded anything.
Any help would be nice, if this is impossible that would also be nice to know so I can quit tearing out my hair.
Thank you all for taking the time to read this.
 

Excel Facts

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

In Sheet 1 your numbers are separated by commas? comma and a space? or just a space?

After that.. you've lost me on what happens in Sheet 2.

Based on what you typed Sheet1!$C$3 you want to make a list of individual values in Sheet2!A:A (column A)?

What happens to Sheet 2 column B? Is that manually input or does the data come from some other cell?

So you want to type one of the values into Sheet2!$D$3 and show the result of its corresponding B-column value.

And at this point I fear I'm completely at a loss for what you want to achieve. Would it be possible to upload a sample file to google drive or something similar with annotations as to what result (even if its just "Here I want C3 values seperated with commas") so we can see what the structure is to better understand what you're looking for?
 
Upvote 0
Some sample data and showing us what you want based on that sample would be nice.

Excel Jeanie
 
Last edited:
Upvote 0
Excel mishap - Album on Imgur

Sheet one is the one with the SKU and Product name
Sheet two is the one that is an inventory list.
Sorry was hoping I would have explained it well.
The numbers would be in the SKU column. Separated by whatever would be easier, a comma, a comma and a space, or just the & sign.
Sheet 2 has the inventory list.
So I am wondering if something could read the data from C3 (the SKU Column) match it to Column A on sheet 2, then read the data in column B on sheet 2 and populate column D on sheet one, with all of that separated by whatever is easier as well. Honestly, that step could be skipped, I don't need the product names on this sheet, I put it there to make it read a bit easier so I would know I put in the proper SKU.
The column for volume on the first picture is where I would desire something to match the SKU number on sheet 2, grab the value in column D, do so for each SKU number and add them together to get a total volume number.
Hopefully the pictures helped.

I am sorry I did not explain it well enough the first time. I had debated putting the pictures up at first but decided against it for some foolish reason.
Thank you again for taking the time to read and respond. As I said if it can't be done, it can't be done. My skills in <acronym title="visual basic for applications">VBA</acronym> and such are rather lacking and I apparently bit off more than I can chew for this personal project.

I already reported my mishap with the failing to post pictures in a reply. Hopefully they remove my eyesore that I caused soon. Sorry about that.
 
Upvote 0
And just figured out can't post pictures.

I gave you a link to where you can get an add-in that will create html that can be pasted into this board giving us a sample formatted to look like what you see below.

Notice it shows us what cells the data is in, what the data consists of and what the sheet name is.

It can also be copied and pasted into a blank workbook.


Sheet1

*AB
Header OneHeader Two

<tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6[/TD]

</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0
Excel 2016 (Windows) 64 bit
[TABLE="class: head"]
<tbody>[TR="bgcolor: #888888"]
[TH][/TH]
[TH]
A
[/TH]
[TH]
B
[/TH]
[TH]
C
[/TH]
[TH]
D
[/TH]
[TH]
E
[/TH]
[TH]
F
[/TH]
[TH]
G
[/TH]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
1
[/TD]
[TD]Month:[/TD]
[TD][/TD]
[TD]Goal:[/TD]
[TD][/TD]
[TD][/TD]
[TD]Total Profit:[/TD]
[TD][/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
2
[/TD]
[TD]Date[/TD]
[TD]Client[/TD]
[TD]SKU[/TD]
[TD]Product Name[/TD]
[TD]Volume[/TD]
[TD]Earn Base[/TD]
[TD]Profit[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
3
[/TD]
[TD][/TD]
[TD][/TD]
[TD]017A[/TD]
[TD]3-Day Trial Pack[/TD]
[TD]
100.5​
[/TD]
[TD]
$113.70​
[/TD]
[TD]
$59.75​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid"]
<tbody>[TR]
[TD]Sheet: Retail Tracker[/TD]
[/TR]
</tbody>[/TABLE]


Excel 2016 (Windows) 64 bit
[TABLE="class: head"]
<tbody>[TR="bgcolor: #888888"]
[TH][/TH]
[TH]
A
[/TH]
[TH]
B
[/TH]
[TH]
C
[/TH]
[TH]
D
[/TH]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
2
[/TD]
[TD]
3123​
[/TD]
[TD]Formula 3 Cell Activator[/TD]
[TD]60 capsules[/TD]
[TD]
21.95​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
3
[/TD]
[TD]
3115​
[/TD]
[TD]Formula 2 Multivitamin Complex[/TD]
[TD]Original 90 Tablets[/TD]
[TD]
19.95​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
4
[/TD]
[TD]
3106​
[/TD]
[TD]Formula 1 Healthy Meal Nutritional Shake mix[/TD]
[TD]French Vanilla 750g[/TD]
[TD]
32.75​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
5
[/TD]
[TD]
2674​
[/TD]
[TD]Formula 1 Healthy Meal Nutritional Shake mix[/TD]
[TD]Dulce de Leche 750g[/TD]
[TD]
32.75​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
6
[/TD]
[TD]
1164​
[/TD]
[TD]Formula 1 Healthy Meal Nutritional Shake mix[/TD]
[TD]Orange Cream 750g[/TD]
[TD]
32.75​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
7
[/TD]
[TD]
1213​
[/TD]
[TD]Formula 1 Healthy Meal Nutritional Shake mix[/TD]
[TD]Vanilla non-GM 750g[/TD]
[TD]
32.75​
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid"]
<tbody>[TR]
[TD]Sheet: Product List[/TD]
[/TR]
</tbody>[/TABLE]



The forum tools add in by Rory on the guidelines page works well in 2016. Sorry it took so long.
 
Last edited:
Upvote 0
Where do you get the volume from? Is it Sheet2ColumnD minus the flavor? (eg. French Vanilla 750g would mean volume is just 750g?)
And are the tablets' volume just "60 tablets/capsules"? Furthermore... what happens when the order is "3123, 3106" One is 60 capsules, the other is 740g... what number do you want for "volume" in this case?

This would be very easy if the volume of each item had its own column in sheet 2... is that possible, or are the number of items too great to make this a worthwhile task? As a general rule, when making a reference chart, its good practice to keep all variables in separate columns for ease in separating them. It becomes more challenging when flavor and quantity is mixed together into one and you have to ask the macro to try and distinguish which one is which...
 
Upvote 0
Huh, the table headers didn't copy, sorry about that. The flavor and names and such are not as needed as explained in a prior post. The volume would be the far right number.

Excel 2016 (Windows) 64 bit
[TABLE="class: head"]
<tbody>[TR="bgcolor: #888888"]
[TH][/TH]
[TH]
A
[/TH]
[TH]
B
[/TH]
[TH]
C
[/TH]
[TH]
D
[/TH]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
1
[/TD]
[TD="bgcolor: #000000"]SKU[/TD]
[TD="bgcolor: #000000"]Product name[/TD]
[TD="bgcolor: #000000"]Product/Type[/TD]
[TD="bgcolor: #000000"]Volume Points[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
2
[/TD]
[TD]
3123​
[/TD]
[TD]Formula 3 Cell Activator[/TD]
[TD]60 capsules[/TD]
[TD]
21.95​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
3
[/TD]
[TD]
3115​
[/TD]
[TD]Formula 2 Multivitamin Complex[/TD]
[TD]Original 90 Tablets[/TD]
[TD]
19.95​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
4
[/TD]
[TD]
3106​
[/TD]
[TD]Formula 1 Healthy Meal Nutritional Shake mix[/TD]
[TD]French Vanilla 750g[/TD]
[TD]
32.75​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
5
[/TD]
[TD]
2674​
[/TD]
[TD]Formula 1 Healthy Meal Nutritional Shake mix[/TD]
[TD]Dulce de Leche 750g[/TD]
[TD]
32.75​
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
6
[/TD]
[TD]
1164​
[/TD]
[TD]Formula 1 Healthy Meal Nutritional Shake mix[/TD]
[TD]Orange Cream 750g[/TD]
[TD]
32.75
[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #888888"]
7
[/TD]
[TD]
1213​
[/TD]
[TD]Formula 1 Healthy Meal Nutritional Shake mix[/TD]
[TD]Vanilla non-GM 750g[/TD]
[TD]
32.75​
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid"]
<tbody>[TR]
[TD]Sheet: Product List[/TD]
[/TR]
</tbody>[/TABLE]

Sadly with the inventory list nearing 200 items at this point leaving it as it is would be better.
the 4 digit number is the SKU, basically telling Excel the what row to grab data from once it matches it.

It would be if there were multiple SKU numbers in the cell C3 in the sheet listed as retail tracker it would add up all of the volume points and produce just the total amount on the retail tracker sheet.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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