Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

reduce number of decimals appearing for calculated variable

  1. #1

    reduce number of decimals appearing for calculated variable

    In my responses.xls file all cells are formatted to show two numbers after the decimal. However, when a calculated variable is shown to participants during the experiment (i.e. how much they earned), there are 6 numbers following the decimal. How can I fix this?

  2. #2
    jarvis24 Blair Jarvis, Administrator
    I just checked to see if Excel has a "truncate" function you could use. Looks like you can create a new variable that references the original number like this: =TRUNC(A1,2)

    I had the value 3.554545 in cell "A1" and this other cell displayed 3.55. I expect that is the actual value (3.55) of the new cell and so it would appear as such in MediaLab.

    Never tried it before so let me know how it goes!

  3. #3
    It worked! Thanks for your help.

  4. #4
    Just an update that you can do this using a few different Excel functions.

    TRUNC simply cuts the number down
    ROUND rounds the number to the amount of decimals (or an integer) that you specify
    MROUND rounds the number to a multiple that you specify

    For instance, I want a money amount returned in .50 increments so I use the formula: =MROUND(cell,.5)