Help

Formula assistance needed - Video aspect ratio Calculation

Topic Labels: Formulas
Solved
Jump to Solution
519 1
cancel
Showing results for 
Search instead for 
Did you mean: 
ppenaranda
4 - Data Explorer
4 - Data Explorer
Hello,
 
I'm encountering an issue with a formula I'm using to calculate video aspect ratios in my Airtable base. I would appreciate any assistance in identifying the problem or suggesting an alternative approach. The formula I'm currently using for {test3} is: {test1} / {test2}Here's the expected behavior of the formula I'm using for aspect ratio calculation:
- If the value of the field {test3} is 1.78, I want the formula to return "16x9".
- If the value is 1.00, I want it to return "1x1".
- If the value is 0.56, I want it to return "9x16".
- If none of these conditions are met, I want it to return a blank result.
 
The formula I'm using for this is:
IF(
    {test3} = 1.78,
    "16x9",
    IF(
        {test3} = 1.00,
        "1x1",
        IF(
            {test3} = 0.56,
            "9x16",
            ""
        )
    )
)
Please note that {test1} and {test2} are numeric fields that store video resolutions.
 
 
However, the formula is currently only returning "1x1" as expected. For the other conditions (1.78 and 0.56), it returns an empty value instead of the corresponding aspect ratio ("16x9" and "9x16" respectively).
 
I would appreciate any insights into what could be causing the issue with this formula or any alternative suggestions to achieve the desired outcome. Thank you for your assistance.
 
Cheers!
1 Solution

Accepted Solutions
ppenaranda
4 - Data Explorer
4 - Data Explorer

After some messing around I figured out that the problem was related to the decimals.
I've added ROUND to the formula and it worked:

IF(
    ROUND({test3}, 2) = 1.78,
    "16x9",
    IF(
        ROUND({test3}, 2) = 1.00,
        "1x1",
        IF(
            ROUND({test3}, 2) = 0.56,
            "9x16",
            IF(
                ROUND({test3}, 2) = 0.67,
                "9x16",
                "New Aspect Ratio. Please add it to the formula"
            )
        )
    )
)


 Hope it helps someone else in the future.

Cheers!

See Solution in Thread

1 Reply 1
ppenaranda
4 - Data Explorer
4 - Data Explorer

After some messing around I figured out that the problem was related to the decimals.
I've added ROUND to the formula and it worked:

IF(
    ROUND({test3}, 2) = 1.78,
    "16x9",
    IF(
        ROUND({test3}, 2) = 1.00,
        "1x1",
        IF(
            ROUND({test3}, 2) = 0.56,
            "9x16",
            IF(
                ROUND({test3}, 2) = 0.67,
                "9x16",
                "New Aspect Ratio. Please add it to the formula"
            )
        )
    )
)


 Hope it helps someone else in the future.

Cheers!