Home > Back-end >  Is there a way to make automatic formatting based on keywords in an array in Google Sheets
Is there a way to make automatic formatting based on keywords in an array in Google Sheets

Time:09-13

So I'm making a spreadsheet to track my macros in an attempt to eat healthier. ="Calories: "&SUMPRODUCT(IFERROR(ARRAYFORMULA(REGEXEXTRACT(B5:L5, "([0-9] )cal")), 0)) &char(10)& "Protein: "&SUMPRODUCT(IFERROR(ARRAYFORMULA(REGEXEXTRACT(B5:L5, "P: ([0-9] )g")), 0))&"g"

This looks at the information given in the cells (E.G. "Salad 320cal P:32) and parses out the data based on the prefix and suffix of the given data.

I would like to make this process even simpler, mainly by using an array of already made data, and using the title of the phrase ("Salad") to call to the data in the array just by typing in the cells.

Is there any setup or function I can use to reroute the data to an array based on a string?

Here is a link to a copy of my spreadsheet with a hopefully more clear set of instructions enter image description here

  • Related