# Help with IF and Calculations using repeating fields

Question asked by StewartCampbell_1 on Apr 24, 2012
Latest reply on Apr 24, 2012 by StewartCampbell_1

### Title

Help with IF and Calculations using repeating fields

### Post

Hello - I am a newbie here, just trying out FMP12 having not used FMP since many years back, trying to remember it all...

I want to create a calculation for one repeating field based on another. The first repeating field are the original prices which can be in different currencies, sometimes USD sometimes EUR. The second, calculated repeating field are to be the final USD prices (rounded to nearest 100 and minus 10). I need an IF function so that if the original prices are already USD, result 1 takes them unchanged to the final prices - but if in another currency they get multiplied by the exchange rate factor (and rounded). So far I have the following formula which works for the first repeated field - but I cannot work out what to do for repetitions 2, 3, 4 etc. Do I have multiple IFs? Can you extend to more repetitions/results in the same IF formula?

If ( currency = "USD" ; GetRepetition ( prices original ; 1 ) ; (Round ( GetRepetition ( prices original ; 1 ) * currencies::currency rate to USD ; -2 ))-10)

Thanks in advance for any help!