Excel DB Search - VBA, Conditional Formatting or Macro?
Excel DB Search - VBA, Conditional Formatting or Macro?
Author
Discussion

BeirutTaxi

Original Poster:

6,636 posts

246 months

Tuesday 9th January 2018
quotequote all
Hi all,

I would be grateful for some help/advice RE: the spreadsheet example in the image below.

As per the image below of my example database, I have recipes (first column) and ingredients and corresponding inclusions %



Essentially what I want to do is create a search tool in Excel that can roughly match a new recipe to an existing one via searching for/comparing and matching the first letter of each ingredient and ideally comparing the percentage inclusions (within +/- 10%). If there is a match within these criteria then the existing recipe is highlighted or copied to a new sheet.

Does anyone have any ideas on how I should approach this? I was hoping to do it via conditional formatting as I don't know VBA yet.

Kind regards,

Matt

21TonyK

13,435 posts

241 months

Wednesday 10th January 2018
quotequote all
I lieu of a more informed answer heres my take having not used Excel in anger for a few years.

You could certainly do it in VBA. If however its not something you are already into then a less elegant answer with logic and conditional formatting might be simpler.

As far as I am aware conditional formatting only allows for single logical comparisons so my solution would be to use a series of either hidden rows within the sheet (or a linked sheet) to make the comparisons using IF statements. The conditional formatting then looks at the combined results of these statements to determine a match.

Make sense?