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

Question

Question

Using Calculation on a table

asked on January 21 Show version history

Hi all, 

Not sure what I am missing with this one

 

I have a table cost_table and the key variablesI am trying to use with the calculation is the cost_amount and cost_type (labeled Cost and Type) and the output field line_cost

I also have a separate number field called number_of_students (this is also populated by a calculation not sure if that makes a differnece)

The formula is set so If the type is set to Per Student (option value 2) I would like it to multiply the cost amount with another field , number_of_students)  However I receive an error.

My formula is 

=IF(cost_table.cost_type=2,MULT(cost_table.cost_amount,number_of_students),3)

 

Have also tried

=IF(cost_table.cost_type=2,(cost_table.cost_amount * number_of_students),3)

 

Any ideas?

Thanks

0 0

Answer

SELECTED ANSWER
replied on January 21

It looks like you need add the number of students to your table.  You can hide the field if the Type isn't Per Student.  Then use this function:

 

=IF(INDEX(cost_table.cost_type, ROW())=2, INDEX(cost_table.cost_amount, ROW()) * INDEX(number_of_students, ROW()), 3)

3 0
replied on January 29

Thanks thatworked!

0 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.