Autocomplete list in cells to select species

%3CLINGO-SUB%20id%3D%22lingo-sub-1136495%22%20slang%3D%22en-US%22%3EAutocomplete%20list%20in%20cells%20to%20select%20species%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1136495%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20fill%20in%20a%20lot%20of%20data%20from%20fieldwork%20sheets%20that%20contain%20species%20names.%20But%20the%20spelling%20of%20such%20names%20is%20often%20difficult%2C%20and%20it%20is%20near%20impossible%20to%20always%20spell%20everything%20correctly.%20So%20I%20would%20love%20an%20autocomplete%20function%20and%20maybe%20dropdown%20list%20for%20the%20cells%20in%20an%20excel%20column%2C%20which%20gives%20me%20suggestions%20as%20I%20start%20typing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20since%20the%20species%20names%20are%20composed%20of%20two%20parts%20(genus%20and%20specific%20epithet%2C%20for%20example%20Panthera%20leo)%2C%20I%20would%20like%20the%20autocomplete%20to%20be%20able%20to%20take%20the%20first%20few%20letters%20of%20the%20genus%20name%20together%20with%20the%20first%20few%20letters%20of%20the%20specific%20epithet%2C%20and%20give%20a%20suggestion%20based%20on%20both.%20If%20I%20only%20type%20the%20first%20part%2C%20then%20all%20suggestions%20will%20come%20up%20which%20have%20those%20letters%20in%20the%20genus%20name.%20The%20website%20iNaturalist%20does%20this%20beautifully%20when%20you%20add%20species%20identifications%20to%20observations.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20an%20example%20with%20Panthera%20leo%20(lion)%20and%20Panthera%20pardus%20(leopard).%20What%20I%20would%20like%20is%20the%20following%3A%20when%20I%20start%20to%20type%20%22pan%22%2C%20or%20even%20just%20%22p%22%2C%20then%20both%20suggestions%20would%20appear%20and%20I%20could%20select%20either%20one.%20But%20if%20I%20type%20%22pan%20par%22%2C%20or%20even%20just%20%22pan%20p%22%2C%20it%20only%20gives%20Panthera%20pardus%20as%20an%20option%2C%20since%20it%20combines%20the%20first%20parts%20of%20both%20words%20to%20give%20a%20suggestion.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESome%20more%20examples.%20First%20a%20list%20(just%20a%20bunch%20of%20plant%20names)%3A%3C%2FP%3E%3CP%3EAdromischus%20diabolicus%3CBR%20%2F%3EAnacampseros%20recurvata%3CBR%20%2F%3EBauhinia%20bowkeri%3CBR%20%2F%3EConophytum%20blandum%3CBR%20%2F%3EConophytum%20limpidum%3CBR%20%2F%3ECrassula%20decumbens%3CBR%20%2F%3EDinteranthus%20wilmotianus%3CBR%20%2F%3EEctadium%20virgatum%3CBR%20%2F%3EHelichrysum%20marmarolepis%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EWhen%20I%20type%20%22con%22%20it%20would%20show%20both%20Conophytum%20blandum%20and%20Conophytum%20limpidum%20as%20options%2C%20but%20if%20I%20type%20%22con%20b%22%20it%20would%20only%20give%20Conophytum%20blandum%20as%20option.%20If%20I%20started%20to%20type%20%22ad%22%20it%20would%20only%20give%20Adromischus%20diabolicus%20as%20option.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20makes%20sense.%20Also%2C%20it%20should%20not%20be%20a%20combo%20box%20if%20possible%2C%20since%20I%20need%20to%20type%20this%20into%20individual%20cells%20of%20a%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20up%20for%20the%20challenge%3F%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1136495%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%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-1136572%22%20slang%3D%22en-US%22%3ERe%3A%20Autocomplete%20list%20in%20cells%20to%20select%20species%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1136572%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F536686%22%20target%3D%22_blank%22%3E%40janhendrik%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPerhaps%20not%20exactly%20what%20you%20had%20in%20mind%2C%20but%20with%20some%20helper%20columns%20you%20can%20achieve%20something%20similar.%20The%20attached%20workbook%20has%20a%20small%20model%20with%20the%20species%20in%20column%20A%20and%20a%20helper%20column%20in%20B%20to%20create%20a%20short-code%20for%20the%20species%20as%20%22first%20three%20characters%2C%20space%2C%20first%20character%20after%20first%20space%22%2C%20e.g.%20%22Con%20b%22.%20This%20short-code%20is%20used%20to%20populate%20your%20dynamic%20drop-down%20list.%20For%20example%2C%20fill%20in%20%22c%22%2C%20%22co%22%2C%20%22con%22%2C%20%22con%20%22%20or%20%22con%20b%22%20in%20H2%20and%20the%20drop-down%20in%20I2%20will%20only%20list%20the%20species%20who's%20(partial)%20short-code%20matches%20H2.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ED1%20picks-up%20the%20last%20short-code%20entered%20in%20column%20H%20and%20uses%20it%20to%20populate%20the%20source%20list%20for%20the%20dropdown%20in%20E.%20So%2C%20as%20long%20as%20you%20work%20down%20column%20H%2C%20the%20last%20short-code%20will%20fill%20the%20drop-down.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167838i5B94AC899D3A60E5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Screenshot%202020-01-29%20at%2008.16.58.png%22%20title%3D%22Screenshot%202020-01-29%20at%2008.16.58.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EShould%20you%20want%20to%20go%20back%20and%20change%20an%20earlier%20entry%2C%20first%20type%20its%20%22partial%22%20short-code%20at%20the%20bottom%20in%20H%2C%20so%20that%20the%20drop-down%20is%20filled%20with%20the%20correct%20values%20again.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20neat%20thing%20is%20that%20your%20entry%20gets%20validated%20only%20upon%20entry.%20Once%20it's%20there%20the%20validation%20list%20may%20change%20without%20causing%20errors.%20Hopefully%2C%20I%20made%20myself%20clear%20and%20you'll%20manage%20to%20incorporate%20this%20idea%20in%20your%20own%20file.%20Just%20keep%20a%20close%20look%20on%20the%20ranges%20in%20the%20formulae%20and%20adjust%20them%20to%20your%20own%20needs.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1136687%22%20slang%3D%22en-US%22%3ERe%3A%20Autocomplete%20list%20in%20cells%20to%20select%20species%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1136687%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F536686%22%20target%3D%22_blank%22%3E%40janhendrik%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20it%20can%20be%20done%20in%20iNaturalist%20it%20can%20might%20also%20be%20possible%20in%20Excel.%26nbsp%3BMy%20gut%20feeling%20tells%20me%20it%20would%20require%20more%20complex%20formulae%20and%2For%20VBA%20coding%20if%20you%20want%20to%20be%20able%20to%20search%20on%20multiple%20(partial)%20words%20to%20populate%20the%20drop-down.%20And%20it%20would%20probably%20require%20more%20time%20than%20the%2015%20minutes%20it%20took%20me%20to%20cook-up%20my%20earlier%20%22solution%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20guess%20it%20all%20depends%20on%20the%20number%20of%20hits%20you%20get%20when%20you%20type%20%22Nnn%20n%22.%20If%20it%20finds%20250%20species%2C%20perhaps%20the%20short%20code%20needs%20to%20be%20%22Nnn%20nnn%22.%20Aternatively%2C%20use%20wildcards%20in%20the%20search%20field.%20Then%20you%20can%20type%20and%20letter%20combination%20in%20the%20list%20of%20species.%20This%20is%20what%20I've%20done%20in%20version%202%20of%20my%20file%20(attached).%20Would%20still%20be%20a%20lot%20easier%20than%20typing%20the%20whole%20name.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1136624%22%20slang%3D%22en-US%22%3ERe%3A%20Autocomplete%20list%20in%20cells%20to%20select%20species%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1136624%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3Emany%20thanks%20for%20such%20a%20speedy%20response!%20I%20am%20going%20to%20look%20at%20the%20formulas%20in%20the%20doc%20you%20gave%20and%20see%20how%20I%20can%20incorporate%20it!%20Seems%20there%20is%20a%20restriction%20on%20the%20number%20of%20letters%20you%20type%3F%20I.e.%2C%20in%20iNaturalist%20you%20can%20type%20any%20amount%20of%20letters%20for%20either%20of%20the%20two%20parts%2C%20or%20just%20the%20first%20(e.g.%20%22a%22%2C%20%22ad%22%2C%20%22adr%22%2C%20%22adromisc%22%20and%20all%20the%20way%20till%20the%20end)%2C%20and%20it%20lists%20accordingly.%20Can%20this%20be%20done%20with%20your%20coding%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi all

 

I fill in a lot of data from fieldwork sheets that contain species names. But the spelling of such names is often difficult, and it is near impossible to always spell everything correctly. So I would love an autocomplete function and maybe dropdown list for the cells in an excel column, which gives me suggestions as I start typing.

 

However, since the species names are composed of two parts (genus and specific epithet, for example Panthera leo), I would like the autocomplete to be able to take the first few letters of the genus name together with the first few letters of the specific epithet, and give a suggestion based on both. If I only type the first part, then all suggestions will come up which have those letters in the genus name. The website iNaturalist does this beautifully when you add species identifications to observations.

 

Here is an example with Panthera leo (lion) and Panthera pardus (leopard). What I would like is the following: when I start to type "pan", or even just "p", then both suggestions would appear and I could select either one. But if I type "pan par", or even just "pan p", it only gives Panthera pardus as an option, since it combines the first parts of both words to give a suggestion.

 

Some more examples. First a list (just a bunch of plant names):

Adromischus diabolicus
Anacampseros recurvata
Bauhinia bowkeri
Conophytum blandum
Conophytum limpidum
Crassula decumbens
Dinteranthus wilmotianus
Ectadium virgatum
Helichrysum marmarolepis

When I type "con" it would show both Conophytum blandum and Conophytum limpidum as options, but if I type "con b" it would only give Conophytum blandum as option. If I started to type "ad" it would only give Adromischus diabolicus as option.

 

Hope this makes sense. Also, it should not be a combo box if possible, since I need to type this into individual cells of a column.

 

Anyone up for the challenge?

3 Replies

@janhendrik 

Perhaps not exactly what you had in mind, but with some helper columns you can achieve something similar. The attached workbook has a small model with the species in column A and a helper column in B to create a short-code for the species as "first three characters, space, first character after first space", e.g. "Con b". This short-code is used to populate your dynamic drop-down list. For example, fill in "c", "co", "con", "con " or "con b" in H2 and the drop-down in I2 will only list the species who's (partial) short-code matches H2.

 

D1 picks-up the last short-code entered in column H and uses it to populate the source list for the dropdown in E. So, as long as you work down column H, the last short-code will fill the drop-down.

Screenshot 2020-01-29 at 08.16.58.png

Should you want to go back and change an earlier entry, first type its "partial" short-code at the bottom in H, so that the drop-down is filled with the correct values again.

 

The neat thing is that your entry gets validated only upon entry. Once it's there the validation list may change without causing errors. Hopefully, I made myself clear and you'll manage to incorporate this idea in your own file. Just keep a close look on the ranges in the formulae and adjust them to your own needs.

 

@Riny_van_Eekelenmany thanks for such a speedy response! I am going to look at the formulas in the doc you gave and see how I can incorporate it! Seems there is a restriction on the number of letters you type? I.e., in iNaturalist you can type any amount of letters for either of the two parts, or just the first (e.g. "a", "ad", "adr", "adromisc" and all the way till the end), and it lists accordingly. Can this be done with your coding?

@janhendrik 

If it can be done in iNaturalist it can might also be possible in Excel. My gut feeling tells me it would require more complex formulae and/or VBA coding if you want to be able to search on multiple (partial) words to populate the drop-down. And it would probably require more time than the 15 minutes it took me to cook-up my earlier "solution".

 

I guess it all depends on the number of hits you get when you type "Nnn n". If it finds 250 species, perhaps the short code needs to be "Nnn nnn". Aternatively, use wildcards in the search field. Then you can type any letter combination in the list of species. This is what I've done in version 2 of my file (attached). Would still be a lot easier than typing the whole name.