Count Multiple Items in a Cell - excel-formula

Is there a way to count how many of each item is in a list like this?
There is a system like this in my job and I would like to automate the counting of items as there can be the occasional item missed.
enter image description here

Are the chairs entered in standard manners? I see row 4 shows BLACK Chair and row 3 shows 2 chairs BLACK. Are these standard ways of representing chair entries? If so, how about this for counting the black chairs.
=IF(C2="BLACK Chair",A2,IF(ISNUMBER(SEARCH("chairs BLACK",C2,1)),VALUE(MID(C2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},C2&1234567890)),FIND(" ",C2,FIND(" ",C2,FIND("+",C2,1))+1)-FIND(" ",C2,FIND("+",C2,1))-1)),0))
I hacked this together a bit so test to make sure it fits you but it seems to be working with my test set.
Then you could create separate columns for each type so maybe column D is black chairs, column E is red chairs.
For the tables, create columns and try:
=IF(ISNUMBER(SEARCH("Beech Table",C2)),A2,0)
Then replicate for other table types.
I don't know how you're getting the data but it would be much easier to separate the data and merge it together for a report total. Something like this (sorry for bad wrapping):
| Black Chairs | Red Chairs | Beech Table | Black Table | Result |
|--------------|------------|-------------|-------------|------------------------------------------------------------|
| 3 | 0 | 0 | 1 | 3 Black Chairs, 1 Black Table |
| 0 | 2 | 1 | 0 | 2 Red Chairs, 1 Beech Table |
| 2 | 2 | 1 | 1 | 2 Black Chairs, 2 Red Chairs, 1 Beech Table, 1 Black Table |

Related

Excel formua like SUMIFs with criteria in different tables

I don't know if I am missing something obvious or what, but I cannot wrap my brain around what I need from this. I have a table with products available for sale and various criteria. I have a second table with a smaller list of stores and a second column of whether I should include them in my results set. In this example, I would never include store 789, but I might include 123 and/or 456, depending on whether an "x" was placed in that second column.
So, for my results, I would break them out by Product and color with a simple SUMIFS statement. However, I really want to be able to filter the sites out if they are "x" on that second tab. Any thoughts on how I could easily do that? I did insert a column on my raw data sheet and just added an if statement, then I used that as a 4th criteria in my SUMIFS, but I was looking for a more elegant solution.
I can get either matching stores or the rest of the filters, but I cannot figure how to make both work together in the same statement or how to include them if they are "x"-ed.
This will get me the filtered stores
=SUMPRODUCT(SUMIF('Tab1'!A:A,'Tab2'!A:A,'Tab1'!D:D))
Either of these will get me the filtered products:
=SUMIFS('Tab1'!D:D, 'Tab1'!B:B, A2, 'Tab1'!C:C, B2)
=SUMPRODUCT(--('Tab1'!B:B=A2), --('Tab1'!C:C=B2), 'Tab1'!D:D)
Tab1
Store | Product | Color | Sales
--------------------------------
123 | A | Red | 1
123 | A | Blue | 2
123 | B | Red | 4
456 | A | Blue | 8
456 | B | Red | 16
789 | A | Red | 32
789 | B | Red | 64
Tab2
Store | Include
---------------
123 |
456 | x
Results:
Product | Color | Sales
------------------------
A | Red | 0
A | Blue | 8
B | Red | 16
Why not use VLookUp's to add the column from Tab2 to Tab1?
For example, new Column E, to the right of Sales:
=VLookUp(A1, "Tab2", 2, False)
...and fill-down?
You could base SumIf criteria on multiple tables but personally I'd just keep the data together (dynamically) just to make it easier and neater.
Build a pivot table and use slicers to include or exclude specific data. Then you don't need a helper table and you don't need formulas, either. Just a few clicks.

Excel dynamic drop down List by filtered table

Hi I have a problem with the data validation list in Excel.
First of all I have one table(named: Article) in a protected Tab with four attributes (Name, Sex, Colour, Price). It is possible that two or more articles have the same name and differ by Sex (male or female) or by colour.
Name | Sex | Colour | Price
-------------|-----------|------------|---------
Product1 | Male | Blue | 10
Product1 | Male | Green | 10
Product1 | Female | Pink | 5
Product2 | Male | Grey | 8
Product2 | Female | Orange | 8
In the main Tab I organized the order in an different table (called: Order).
Product | Sex | Colour | Quantity | Price
-------------|-----------|------------|------------|---------
<List> | <List> | <List> | | <Calculation>
The dropdown List for Product (Data Validation | List | Source -> =INDIREKT("Article[Name]"))
and Sex (Data Validation | List | Source -> Male; Female) is easy.
But how I get a list for Colour - depended on Productname and Sex?
For example Product = Product1 and Sex = Male the drop down for colour should contain Blue and Green.
First you need to change the structure of your table. Either copy and transpose this with an array formula, entered as Ctrl+Shift+Enter:
=TRANSPOSE(TABLE)
You need your table in the following form:
Product 1 | Product2 | Product 3
Green | Grey | Pink
Blue | Orange | White
Then, you define each of those columns as a named range. You can select the entire table and go to Formulas > Create from selection (in the Defined Names section). Mark only "Top row" and click ok. Now you have named ranges you can use in your dependent or cascading dropdown list. In this one, your source will be:
=INDIRECT(A1) 'Replace A1 with the location of your first-level dropdownlist
Of course, it becomes considerably more complicated if you need to add an extra condition to your secondary dropdown. Firstly, your table needs to be in the following structure:
Product 1Male | Product1Female | Product 2Male | Product 2Female
Green | Grey | Pink | Red
Blue | Orange | White | Pink
And the formula for your dependent dropdown would be:
=INDIRECT(A1&A2) 'Where A1 and A2 are the locations of your other 2 dropdown lists.
That should work as you need it. Let me know if further clarification is needed.

Can I populate a column with conditional data while omitting empty rows or possibly autosort?

In one spreadsheet document, file.xlsx, I have 2 sheets. Sheet1 has the editable fields. Sheet 2's sole purpose is to read the data from Sheet1.
The point is to keep track of inventory and easily display items needed to be ordered.
Sheet1 'column a' is item number for ordering
Sheet1 'column b' is the number I have on hand
Sheet1 'column c' is the formula cell to find the number needed to be ordered
It looks something like this:
Document1:sheet1
A | B | C |
1 |txt1 | 1 | =10-b1 |
2 |txt2 | 0 | =10-b2 |
3 |txt3 | 13 | =10-b3 |
4 |txt4 | 5 | =10-b3 |
5 |txt5 | 2 | =10-b4 |
There is some if statement conditional formatting in the "C" column to check if the "B" column has a value HIGHER than 10 and if it hits true then the corresponding C cell is blank but for space, i'm summarizing here
Document1:sheet2
A | B |
1 |=if(sheet1!C1>0,Sheet1!A1,"") |=if(sheet1!C1>0,Sheet1!C1,"") |
2 |=if(sheet1!C2>0,Sheet1!A2,"") |=if(sheet1!C1>0,Sheet1!C2,"") |
3 |=if(sheet1!C3>0,Sheet1!A3,"") |=if(sheet1!C1>0,Sheet1!C3,"") |
4 |=if(sheet1!C4>0,Sheet1!A4,"") |=if(sheet1!C1>0,Sheet1!C4,"") |
5 |=if(sheet1!C5>0,Sheet1!A5,"") |=if(sheet1!C1>0,Sheet1!C5,"") |
If an item isn't to be ordered because stock is high, it doesn't show up in the list. This is ok. It looks like this:
Document1:sheet2
A | B |
1 | txt1 | 9 |
2 | txt2 | 10 |
3 | | |
4 | txt4 | 9 |
5 | | |
What I would like to see is:
Document1:sheet2
A | B |
1 | txt1 | 9 |
2 | txt2 | 10 |
3 | txt4 | 9 |
4 | | |
5 | | |
For 5 Items in the example, it doesn't seem that annoying, but in actuality I have 1200 potential rows and it varies between 200 to 800 actually populated each time i conduct inventory. The whole point is to have one continuous section of rows that I can select and print. Maybe some way of autosorting and placing the empty ones on the bottom?
I've taught myself excel. I don't know the advanced tricks and things.
I'm a typically a programmer but I've been tasked with this project and the guys upstairs want me to do it in excel.
i've overcomplicated this, to the max.
a simple sort putting the empty's at the bottom is the resolution.
not quite as automated as i'd like
but
it works.

Find count of items in column and add the values from another column

I have two columns in a table (A and B). Column A has an item name and Column B has a quantity. I want to sum the quantities for all the items that have the same name. Example:
Item | Quantity
------------+----------
Red Hat | 3
Green Shirt | 9
Red Hat | 4
Blue Pants | 6
Blue Pants | 3
Green Shirt | 12
and I would like to add a column to the table that has this:
Item | Quantity | Total
------------+------------+-------
Red Hat | 3 | 7
Green Shirt | 9 | 21
Red Hat | 4 | 7
Blue Pants | 6 | 9
Blue Pants | 3 | 9
Green Shirt | 12 | 21
I want to be able to sort the table by the items that have the most total quantity (keeping it grouped by the item name, so if two items have the same total quantity, I would like them grouped separately).
Try the SUMIF function. See http://www.techonthenet.com/excel/formulas/sumif.php for more details.
More specifically, the formula for cell C1 should be:
=SUMIF(A:A,A1,B:B)
Assuming columns A and B are item and quantity respectively.

Excel search value from whatever row and if found on another row replace that row with the value in the first row

What I am Trying to do is
lets say I have a excel sheet with
rows
ProductNo | Product | Sku | Price | Image | Thumb
25 | Shirt Blue | 4251 | $10 | shirt.jpg | shirtthumb.jpg
2 | Shirt Green | 4581 | $17 | green.jpg | greenthumb.jpg
8 | Shirt Black | 4561 | $15 | black.jpg | blackthumb.jpg
and just in different rows or on another excel sheet
ProductNo | Product | Sku | Price | Image | Thumb
25 | Shirt Blue | 4251 | $52 | |
2 | Shirt Green | 4581 | $42 | |
8 | Shirt Black | 4561 | $65 | |
How can i change the first table to update if the the second table or sheet columns data is different on specified columns and if the cells are empty forget about them ignore them and just replace the values from the second table onto the first
Final would be
ProductNo | Product | Sku | Price | Image | Thumb
25 | Shirt Blue | 4251 | $52 | shirt.jpg | shirtthumb.jpg
2 | Shirt Green | 4581 | $42 | green.jpg | greenthumb.jpg
8 | Shirt Black | 4561 | $65 | black.jpg | blackthumb.jpg
I have tried a couple of excel functions but they do not work since i have so many products to be doing cell additions
I tried doing in Vl but got confused and macro i dont even know what it is
Im open to whatever visual, functions just as long as i can perform the task
if anybody know hos let me know
Thank You
in stead of having the fixed values I propose you use a permanent formula in the specified columns.
Now to do this I would use a VLOOKUP() function. I am assuming that your ProductNo is the element that never changes therefore all the other columns will get a VLOOKUP() function.
Now if I understand correctly you MIGHT have an update in the 2nd table for the 1st table, but any empty cells in the 2nd table should be ignored.
I am also assuming you wish to see when an element will change because of the update therefore I propose the following:
In the first table add for the block of columns elements that might need an update: 2 blocks of columns, the first with the result of combining (the COMB-block) and the second with lookups from the 2nd table (the LOOKUP-block). For convenience of explaining I put the two tables in the same workbook on the sheets called table1 and table2
ProductNo | Product | Sku | Price | Image | Thumb | Product_comb | Sku_comb | Price_comb | Image_comb | Thumb_comb | Product_lookup | Sku_lookup | Price_lookup | Image_lookup | Thumb_lookup
Now start with formulas in the LOOKUP-block, use VLOOKUP(), such as this one for the *Product_vlookup* column:
=IFERROR(VLOOKUP($A2,table2!$A:B,COLUMNS(table2!$A:B),FALSE),"")
The IFERROR is for the case the product in table1 cannot be found in table2
For the formulas in the COMB-block the following will prefer the table 2 result over the table 1 result. As VLOOKUP of a matching ProductNo with an empty Element (for example for the Image) will result in a 0 (zero) returned all zeroes are regarded false lookup results as well. This is the script for the *Product_comb* column:
=IF(OR(ISBLANK(L2),L2=0),B2,L2)
As a final step to identify the products that changed you can either add a column that compared the original value with the _comb value:
=AND(B2=G2,C2=H2,D2=I2,E2=J2,F2=K2) (this returns true for no changed columns and false for any changed column)
Or use conditional formatting on each element separately or on the combination as the AND() formula shows.
As a final step in your process of updating you could copy all records from the COMB-block and paste it over the original elements.
If you have any further questions please ask.

Resources