cancel
Showing results for
Did you mean:
Frequent Visitor

## Determining Age Range based on Age Variable

Hello all!

I am really stuck here and am hoping that someone can assist with my issue. I am working on migrating a workflow from SharePoint Designer that currently calculate the cost of life insurance for an employee. The insurance costs are based on the age range you fall into. I have already calculated the age successfully and have it saved stored in a variable called 'EmployeeAge'.  Here is an example of the ranges:

 Age Range Rate Under 25 0.09 25-29 0.08 30-34 0.09 35-39 0.11

If I have an employee that has an EmployeeAge of 28, I need the Rate variable to updated with .08.

Does anyone have an idea of how to accomplish this cleanly? I know of a formula in excel for this and was trying to figure out how to replicate this functionality and store the age range in a variable and then add a Switch to set the Rate variable.

=LOOKUP(B2,{0,"0-24";25,"25-29";30,"30-34"})

I appreciate the help!!

~Kayne

2 REPLIES 2
Super User

I have a long and dirty workaround for you that is easy to implement and undersatnd. You can create nested if conditions and manipulate variable values to get the appropriate rate. Please see the screenshots below and replicate:

I have an nteger variable that is the age and a float variable that is rate and using nested if condtion actions, i am setting the value of the rate variable.

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Post Prodigy

Hi @kkreitzer,

Currently, there is no function that can partition Numbers in flow like excel. You can refer to the following flow to establish three conditions, which can divide Age into different data segments, then you can set the rate according to the Age.

Best Regards,

Community Support Team _ Lin Tu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Celebrating the May Super User of the Month: Laurens Martens

@LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!

#### Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!