Excel COUNTIF for comma separated values - excel

I have the following range of values:
National museum of Natural History
Archaeological Museum, Art Museum, Agricultural Museum, Marine Museum
National museum of Natural History, Art Museum
National museum of Natural History, Archaeological Museum, Science Museum
Open-air Museum, Art Museum
This means there can be more than one value in one column, separated by commas.
I want to count each value, for example: all "Archaeological Museum" in this range. I have used the COUNTIF method but it seems not to be enough:
COUNTIF(A1:A6, "Archaeological Museum")
=> result: 0
=> expected result: 2
Is there an only way to spilt the column based on comma or is there any other ways without creating a new column?

This is not a dumb question. This one has been asked and answer many time prior.
I would do it like show on this answer

Related

Ratios of co-occurrence probabilities can encode meaning components

I'studying NLP these days through CS224N, which is NLP lecture in Stanford, and I had a question of co-occurrence probability.
I can understand that each first row and second row shows co-occurrence probability, but it's hard to understand last row. Hard to figure out what it is...
In lecture, said that meaning component is something like female to male, king to queen. I thought would be gender in this example.
In last row I thought it was condition, but hard to find correlation between Large and Small..
enter image description here

Excel - highlight cells if a percentage of the text is the same

I have a single column spreadsheet with thousands of rows of business names.
There are many, many duplicates which are easy enough to find and purge. However are even more partial matches. For example, there is a law firm that I have seen listed multiple ways -
Jones, Smith and Paul
Jones, Smith, and Paul
Jones, Smith & Paul
Jones, Smith & Paul, LLC
Jones, Smith, Johnson & Paul, LLC
There are so many variations in these business names. The idea I keep coming back to is creating a formula to highlight cells than contain X% of same text/characters. That way, I could make a few passes, say one pass with 50% matching text, 75% matching text, etc.
I have been scouring the google and while I come across many posts asking similar things, I haven't come across anything that will solve this for me.
For anyone who comes across this in the future, Microsoft made an Excel plugin called Fuzzy Lookup that accomplishes exactly this partial/percentage based matching.

variable length substring of a string with specific beginning and ending

I have to extract a substring which is always variable in length from within the middle of a string (cell) in excel.
The criteria is:
it is always starting with a specific set of symbols (in this example "Ingredients:")
it is always ending with a specific set of symbols (in this example "Table of Nutritional Information").
The length can be any from 1 word to about 500.
It could be an excel formula or even VBA. But I am a complete beginner with VBA, so please give specific advice there.
My example cell content is like this:
We could tell you that our Beanz are hard to beat. That they're brimming with deliciously rich, tomatoey flavour. But you already know that. Because you know what Beanz Meanz...
Heinz baked beans don't just taste great, but are nutritious too; high in fibre, high in protein and low in fat, as well as contributing to 1 of your 5 a day. Packed full of quality ingredients... it has to be Heinz. Love our Heinz Beanz as much as we do? Discover the rest of our range, including organic and no added sugar varieties!
Heinz Beanz come in a variety of multipacks, perfect for when you need to feed the whole family!
1 of your 5 a day.
No artificial colours, flavours or preservatives.
Suitable for Vegetarians and Vegans.
Naturally high in protein and fibre.
Gluten free and low in fat.
Ingredients:
Beans (51%), Tomatoes (34%), GRAIN, Water, Sugar, Spirit Vinegar, Modified Corn Flour, Salt, Spice Extracts, Herb Extract.
Suitable for Vegetarians. Free From Artificial Flavours.
Empty unused contents into a suitable covered container. Keep refrigerated and use within 2 days.
Table of Nutritional Information
Per 100g Per 1/2 can %RI*
Energy 329kJ 682kJ -
78kcal 162kcal 8%
Fat 0.2g 0.4g 1%
- of which saturates <0.1g <0.1g <1%
Carbohydrate 12.5g 25.9g 10%
- of which sugars 4.7g 9.8g 11%
Fibre 3.7g 7.7g -
Protein 4.7g 9.7g 19%
Salt 0.6g 1.2g 21%
*RI per serving. Reference intake of an average adult (8400kJ/2000kcal)
The desired outcome would be:
Ingredients:
Beans (51%), Tomatoes (34%), GRAIN, Water, Sugar, Spirit Vinegar, Modified Corn Flour, Salt, Spice Extracts, Herb Extract.
Suitable for Vegetarians. Free From Artificial Flavours.
Empty unused contents into a suitable covered container. Keep refrigerated and use within 2 days.
Let's say your example cell is A1, then in another cell you can do:
=TRIM(MID(A1;SEARCH("Ingredients:";A1);SEARCH("Table of Nutritional Information";A1)-SEARCH("Ingredients:";A1)))
You will probably will have to adapt a little bit to get rid of final breaklines.
This is how it works:
SEARCH("Ingredients:";A1) will find the position of the first coincidence of text Ingredientes. returning a number. This will be starting point of extracting text with MID.
SEARCH("Table of Nutritional Information";A1) same than before, but with text Table of Nutritional Information. So this is the end point of extracting text
Step 2 - Step 1 will return how many chars you want to extract, starting at Step 1.
TRIM will just delete extra blanks if added. Notice that extra blanks are not the same than breaklines.
In this case, to get rid of final BREAKLINES, just do extra -5:
=TRIM(MID(A1;SEARCH("Ingredients:";A1);SEARCH("Table of Nutritional Information";A1)-5-SEARCH("Ingredients:";A1)))
This will return the exact output you want, but don't know if it will work with all your inputs.
Assume source data housed in column A, put criteria header "Ingredients" & "Table of Nutritional Information" in B1 and C1.
Then,
In B2, formula copied down :
=MID(LEFT($A2,FIND(C$1,$A2)-1),FIND(B$1,$A2)+LEN(B$1)+1,599)

Algorithm to match IBAN to BIC

I'm trying to find a solution to convert IBANs to BICs.
In theory, all I need is to have a db with national bank codes and their BICs to compare these national codes with corresponding ones in IBANs (based on IBAN format for that country described in https://www.swift.com/sites/default/files/resources/swift_standards_ibanregistry.pdf). But the problem is, that I can only find limited and not accurate sources of national bank codes (or can't find at all, even for big ones).
Is there a way to find a BIC number for a given IBAN in another way? I also thought about first 4 letters in a BIC code, which represents financial institution - but I did not find if it's possible to convert them to "national" codes or vise versa).

How to optimize a fantasy sports line-up with Excel Solver

I have set-up a file with player names, positions, statistics, rankings, and salaries. I am trying to use Excel Solver (as described by #Ioannis regarding a football post from October 2013) to optimize a fantasy baseball line-up. The issue is Excel is picking players for positions they do not play. For example, a pitcher is being selected as the optimal outfielder in my "answer" line-up. How do I tell Excel to recognize the positions that I've posted above each player's name in my data table so that the "answer" matches the real-life position eligibility for each player?
Thank you so much! I'm pretty much brand new to the Solver add-in, but I'm very fascinated by it.
Drew
What you describe is an additional set of constraints. The typical way to incorporate such constraints is to have a binary matrix of player names as rows and positions as columns. A 1 in any (player,position) pair should denote the position of that particular player. Then you should have formulas that link the binary player variables with the number of players used in each position. Think about the spreadsheet design carefully, because it might become messy. For more than 200 variables you might want to check SolverStudio or OpenSolver. – Ioannis

Resources