• Resolved Marleen M

    (@marleen-meert)


    I have a table with items containing prices in USD (column C). I want to convert these amounts to EUR in another column (column D). I use a shortcode to get the exchange rate from USD to EUR (cell A1), that works fine. But then I want to multiply the price in USD with the outcome of the shortcode (eg =C2*A1). This gives an error because the outcome of the shortcode is not considered numeric.
    As an alternative I could use the USD amount in column C as an input to the shortcode for the exchange rate but that’s not working either ([convert number=C2 dp=3 from=”usd” to=”eur”]).
    Also incorporating the shortcode in a formula doesn’t seem to work (=C2*[convert number=1 dp=3 from=”usd” to=”eur”])
    Any idea how to get this working?
    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The best solution should be to use the cell reference inside the Shortcode formula, as you already tried. It will just have to formatted as a formula with text around it (see https://tablepress.org/tablepress-features-formulas/ ):

    =[convert number={C2} dp=3 from=usd to=eur /]
    

    Note the extra = at the beginning (to show TablePress that this is a formula), and the { and } around the C2 to show that the part in between is the actual formula, whereas the part outside should be treated as text by the formula parser.
    For this to work, the cell value in C2 must be purely numeric though (or a formula itself).

    Regards,
    Tobias

    Thread Starter Marleen M

    (@marleen-meert)

    Brilliant, it works! Love this plugin!
    Thank you!

    Best regards,
    Marleen

    Thread Starter Marleen M

    (@marleen-meert)

    thanks

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘using output of shortcode as input in table cell formula’ is closed to new replies.