Interacting with multiple entries in data validation

%3CLINGO-SUB%20id%3D%22lingo-sub-1545971%22%20slang%3D%22en-US%22%3EInteracting%20with%20multiple%20entries%20in%20data%20validation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1545971%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20am%20trying%20to%20make%20an%20inventory%20spreadsheet%20for%20my%20bag%20business.%20Each%20bag%20is%20made%20out%20of%201-4%20used%20pairs%20of%20pants.%20I%20often%20use%20a%20same%20pair%20for%20several%20different%20bags%2C%20and%20often%20use%20several%20pairs%20for%20one%20bag.%20For%20each%20row%20where%20I%20log%20a%20bag%2C%20I%20want%20to%20have%20a%20drop-down%20menu%20where%20I%20can%20select%20which%20pants%20were%20used%20to%20make%20the%20bag.%20I%20found%20some%20code%20online%20that%20allows%20me%20to%20enter%20several%20items%20from%20the%20drop-down%20menu%20with%20commas%2C%20but%20this%20becomes%20an%20issue%20when%20I%20try%20the%20COUNTIF%20formula%20to%20see%20how%20many%20bags%20each%20pair%20of%20pants%20contributed%20to%20(the%20formula%20only%20recognizes%20that%20pants%20were%20used%20if%20the%20entry%20is%20alone%20in%20the%20cell%2C%20not%20separated%20by%20a%20comma%20with%20other%20entries).%20My%20goal%20is%20to%20be%20able%20to%20figure%20out%20the%20materials%20cost%20for%20each%20bag%20(i.e.%2C%20the%20cost%20of%20the%20pants%20used%2C%20where%20each%20price%20of%20pants%20is%20divided%20by%20the%20number%20of%20bags%20it%20is%20used%20in).%20Does%20anyone%20have%20any%20tips%20or%20ideas%20on%20how%20to%20do%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1545971%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1545974%22%20slang%3D%22en-US%22%3ERe%3A%20Interacting%20with%20multiple%20entries%20in%20data%20validation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1545974%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F739941%22%20target%3D%22_blank%22%3E%40sarahnocquet%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECOUNTIF%20supports%20wildcards%2C%20so%20instead%20of%20(for%20example)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DCOUNTIF(A2%3AA100%2C%20%22chinos%22)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eyou%20can%20use%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DCOUNTIF(A2%3AA100%2C%20%22*chinos*%22)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20latter%20formula%20will%20count%20all%20cells%20in%20A2%3AA100%20that%20contain%20the%20text%20%3CEM%3Echinos%3C%2FEM%3E%20together%20with%20possibly%20other%20text.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi, I am trying to make an inventory spreadsheet for my bag business. Each bag is made out of 1-4 used pairs of pants. I often use a same pair for several different bags, and often use several pairs for one bag. For each row where I log a bag, I want to have a drop-down menu where I can select which pants were used to make the bag. I found some code online that allows me to enter several items from the drop-down menu with commas, but this becomes an issue when I try the COUNTIF formula to see how many bags each pair of pants contributed to (the formula only recognizes that pants were used if the entry is alone in the cell, not separated by a comma with other entries). My goal is to be able to figure out the materials cost for each bag (i.e., the cost of the pants used, where each price of pants is divided by the number of bags it is used in). Does anyone have any tips or ideas on how to do this?

2 Replies

@sarahnocquet 

COUNTIF supports wildcards, so instead of (for example)

 

=COUNTIF(A2:A100, "chinos")

 

you can use

 

=COUNTIF(A2:A100, "*chinos*")

 

The latter formula will count all cells in A2:A100 that contain the text chinos together with possibly other text.

@sarahnocquet , Based on your description, I mocked a spreadsheet that calculates the cost of bag based on the price of pants and how they are used. You can add a bag to the bottom of the left table and select the pants used to see the calculated cost change for all bags. Let me know if this is what you are envisioning.