Kinda complex calculations on bubble like calculating maximum, miniumum values from inputs

Building something similar to a calculator app where users input multiple values in multiple fields on a single page. I would like to perform calculations on these user inputs similar to calculations I could make in excel or google sheets. This is an example of a formula I would like to put into an expression that would be displayed for the user in a text box(and maybe later can be saved to a database)

Billing_Cost=(min(Total_Hours_Billed,Hours_Logged_Employee_A)×Hourly_Rate_Employee_A)+(max(0,Total_Hours_Billed−Hours_Logged_Employee_A)×Hourly_Rate_Employee_B)

I tried using expressions and was not able to get it working. Im also curious to know whether there is a more efficient way of making these calculations in the backend. Your help is truly appreciated.

Hi! This seems to be a straightforward implementation using paranthesis in Bubble. Any reason you could not get that to work?

Hi, how would you enter the first part of this formula in bubble? ie finding the minimum between total hours billed, hours logged employee A then multiplying the minimum by Hourly rate employee A

Using the min and max operators in Bubble could be of use for you here. Let me know in case this doesn’t work though