You are viewing limited content. For full access, please sign in.

Question

Question

calculation in table for if then

asked on May 20, 2020

How can I make this IF/THEN calculation work in a lookup table?

=IF(INDEX(Order.CostShare,ROW())="50%"(DIV(INDEX(Order.Cost,ROW()),50)

This is what I want to do:

  • NOTE:  CostShare is a drop-down pick list of either 50% or 0% (on each row of the table)
  • The plan is to calculate:
    • If CostShare is 50%, then divide "Cost" by 50
    • But if CostShare is 0%, then divide "Cost" by 0
0 0

Answer

SELECTED ANSWER
replied on May 20, 2020

Hi Connie,

I'm assuming by "if CostShare is 0%, then divide "Cost" by 0" you mean to not divide it at all, since you can't divide by 0 smiley

That said, your formula is pretty close already:

=IF(INDEX(Order.CostShare,ROW())="50%", DIV(INDEX(Order.Cost,ROW()),50), INDEX(Order.Cost,ROW())

 

0 0
replied on May 20, 2020

It's working!  Thanks, so much, Jim!  I did have to change one thing.  In the middle part, I had to change the 50 to 2 -- "if 50%, divide by 2" - I had that wrong in my original line.

Just so you know why I left the zero option in, it is to accommodate the users, its what they are used to seeing, but also because there may be other options in the future and I wanted to see how the formula would work if it would have lets say, choices of 50% or 25% instead of 0%.  Thanks again!!

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.