Skip to main content

If/then formula

  • February 25, 2023
  • 6 replies
  • 36 views

Forum|alt.badge.img+2

Hello, I want to calculate the total cost per tickets ONLY IF they are a specific type, and then I want to deduct that from a total amount that I set manually. My fields are currently set up: 

Total tickets (# field)
Per ticket cost ($ currency)
Total cost (simple formula: {Per ticket Cost}* {Total Student tickets}) 
Revenue source (single line text)

Right now, I have "IF({Revenue Source}="X", {Total cost}-40,000)", but it's returning 0. Any tips? Thank you!! 

6 replies

TheTimeSavingCo
Forum|alt.badge.img+31
  • Brainy
  • 6414 replies
  • February 25, 2023

Any chance you could share a screenshot so I can help with troubleshooting?  Or if you could provide a link to a base with example data that would be excellent


Ben_Young1
Forum|alt.badge.img+22
  • Brainy
  • 520 replies
  • February 25, 2023

Hey @Shirley_Kawafuc!

I think that the comma in your 40,000 value could be causing unexpected problems.
Try this:

IF( {Revenue Source} = "X", {Total cost} - 40000 )

Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • 7 replies
  • February 27, 2023

Thank you so much @Ben_Young1 and @TheTimeSavingCo! Removing the comma fixed the formula. I'd like the "Deduct Formula" column to continue subtracting from my set total of $40,000 budget IF there is a "Total cost" associated with student tickets (see screenshot). By chance do you know to achieve this? Do I need to add a hidden column that holds just the set budget amount? 


Ben_Young1
Forum|alt.badge.img+22
  • Brainy
  • 520 replies
  • February 27, 2023

Thank you so much @Ben_Young1 and @TheTimeSavingCo! Removing the comma fixed the formula. I'd like the "Deduct Formula" column to continue subtracting from my set total of $40,000 budget IF there is a "Total cost" associated with student tickets (see screenshot). By chance do you know to achieve this? Do I need to add a hidden column that holds just the set budget amount? 


Hey @Shirley_Kawafuc, are you looking to get something along the lines of this?


Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • 7 replies
  • March 13, 2023

Hi @Ben_Young1 , yes! The only change is: I want the "Remaining Budget" amount to get smaller and smaller as the total costs accrue, instead of each line starting over from $40,000 every time. 


Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • 7 replies
  • March 13, 2023

Weirdly, for some reason, my Deduct formula column isn't working now. In screenshot, you'll see the amounts it's giving are incorrect. I have the formula set up like:

 

IF(
{Revenue Source} = "Student ticket Campaign",
{Total cost} - 44,899
)