formula for values on multiple lines

smakatura

Board Regular
Joined
May 27, 2011
Messages
141
I have 400+ rows of data and want to use a formula not a pivot table to return value. I will be using the "color value" returned value in a different formula.

data has item# on each row. any item number could be different colors (imagine a shirt with an item number 1111 that is available in blue or red).

so lets say in the last week I sold the following shirts (each line represents one shirt sold)
[TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 64, bgcolor: transparent"]A
[/TD]
[TD="class: xl65, width: 64, bgcolor: transparent"]B
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]item #
[/TD]
[TD="class: xl65, bgcolor: transparent"]color
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1111
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1122
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1122
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1133
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1133
[/TD]
[TD="class: xl65, bgcolor: transparent"]blue
[/TD]
[/TR]
</tbody>[/TABLE]


If I do a countif formula on column c I can see how many times an item number was sold - regardless of the color of the shirt
[TABLE="width: 204"]
<tbody>[TR]
[TD="class: xl65, width: 64, bgcolor: transparent"]A
[/TD]
[TD="class: xl65, width: 64, bgcolor: transparent"]B
[/TD]
[TD="class: xl65, width: 144, bgcolor: transparent"]C
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]item #
[/TD]
[TD="class: xl65, bgcolor: transparent"]color
[/TD]
[TD="class: xl65, bgcolor: transparent"]count of item number
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1111
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[TD="class: xl65, bgcolor: transparent"]1
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1122
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[TD="class: xl65, bgcolor: transparent"]2
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1122
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[TD="class: xl65, bgcolor: transparent"]2
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1133
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[TD="class: xl65, bgcolor: transparent"]2
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1133
[/TD]
[TD="class: xl65, bgcolor: transparent"]blue
[/TD]
[TD="class: xl65, bgcolor: transparent"]2
[/TD]
[/TR]
</tbody>[/TABLE]


I want a formula in column D that will say if the colors sold were all one color or if they were multiple colors. so if shirt 1122 sold 2 shirts and both were red, it will return "Red". whereas shirt 1133 sold 2 but since there was a red and blue shirt sold, it will return "multiple colors". obviously if there is only one shirt sold of a number (1111), it returns the color of the shirt sold
[TABLE="width: 280"]
<tbody>[TR]
[TD="class: xl65, width: 64, bgcolor: transparent"]A
[/TD]
[TD="class: xl65, width: 64, bgcolor: transparent"]B
[/TD]
[TD="class: xl65, width: 144, bgcolor: transparent"]C
[/TD]
[TD="class: xl65, width: 101, bgcolor: transparent"]D
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]item #
[/TD]
[TD="class: xl65, bgcolor: transparent"]color
[/TD]
[TD="class: xl65, bgcolor: transparent"]count of item number
[/TD]
[TD="class: xl65, bgcolor: transparent"]color value
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1111
[/TD]
[TD="class: xl65, bgcolor: transparent"]blue
[/TD]
[TD="class: xl65, bgcolor: transparent"]1
[/TD]
[TD="class: xl65, bgcolor: transparent"]blue
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1122
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[TD="class: xl65, bgcolor: transparent"]2
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1122
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[TD="class: xl65, bgcolor: transparent"]2
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1133
[/TD]
[TD="class: xl65, bgcolor: transparent"]red
[/TD]
[TD="class: xl65, bgcolor: transparent"]2
[/TD]
[TD="class: xl65, bgcolor: transparent"]multiple colors
[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]1133
[/TD]
[TD="class: xl65, bgcolor: transparent"]blue
[/TD]
[TD="class: xl65, bgcolor: transparent"]2
[/TD]
[TD="class: xl65, bgcolor: transparent"]multiple colors
[/TD]
[/TR]
</tbody>[/TABLE]


I am unsure how to do the color value formula
 
Last edited:

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.

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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