# Ideas to speed up my app?

I’m creating an app that makes a nutritional plan according to the user, they send their details through a form and can edit whenever they want.

I have a sheet that calculates their caloric needs and according to that needs creates a plan to lose weight, maintain or gain weight.

Problem is: through the google sheet I’ve made it so far using many IFS formulas (choosing either to lose weight, gain weight, maintain and the nutritional plan they want -there are three kinds-) on top of that in regards to which week the user is in (plans last 8 weeks), the app through another big big IFS decides which image to show.

I don’t know if it’s because of connection lag or too many calcs to resolve before the apps shows results but the user feeling is terrible, it takes about 10s to update the data and maybe more than a minute to show the image. I started doing with math columns (which show data instantly) via data editor but I need sooo many columns that I have the feeling that this must have a better solution. What do you guys think?

Thanks everyone!

Sounds like a calculation complexity problem, how many IFS did you have in your nested formula in the Sheets?

Not so many but the ones I have are very long formulas, something like:

IF gender = “male” AND activity level = “loe” AND goal = “lose weight” AND calories needed are <2000 AND <2500 AND diet = “low carb” then X

And so on for the 2 choices for male/female, caloric ranges from 1250 to 3750 every 500cals, 3 kinds of diets, 3 types of goals, 3 activity levels, 8 weeks… one more similar formula to choose one image or another… quite messy, formula is not exactly like that of course but I hope you can get yourself an idea!

How many scenarios do you have in total? How about making a sheet that contains:

• Column A: Specific scenario - let’s say “Male - Low - Lose Weight - Calories < 2000”
• Column B: Intended outcome - “Link to image”

Then when a user fills your form, concatenate his/her inputs and then use a simple vlookup to get the intended image?

Let’s see, it works like this:

You fill out the form:

• Age
• Weight
• Height
• Gender
• Activity level
• Goal
• Dieting preference

App calculates your caloric needs according to: age, weight, height, gender and activity level.

Then calculates your:

• Calories
• Proteins
• Carbs
• Fats

for an 8 weeks long plan (so different calcs each week) aaand your dieting preference:

• Zone diet
• Low fat
• Low carb

and different goals:

• Lose weight
• Maintain
• Gain weight

(This makes different math for wether you want to lose weight or gain, one diet or another and the week you are in)

Here you have the app in case you wanna see, it might help understanding the needs:

https://drzxv.glideapp.io/ (only low fat images are shown at the moment)

Thanks for reaching out!

I have just tested it. I would say its flow is very well organized and it generated pretty quick. As you have mentioned you’re currently using Glide’s Math column for this?

I don’t think speed is an issue anymore, at least from my experience. How many Math columns are you using to achieve this?

Did it? I haven’t changed anything yet, I have math columns for the starting values of carbs protein and fats, the rest comes from the sheet.
Sheet calculates the total calories, then math columns for the partitioning and sheet again to choose proper values according to the user.

I attached a video of my experience, that was pretty fast I think. Any comments?

The best way to speed up any app is to use Glide data columns rather than spreadsheet formulas. Spreadsheet formulas = lag. Data columns = instant gratification