Skip to main content
Solved

Nested IF Statement

  • January 13, 2025
  • 3 replies
  • 41 views

Forum|alt.badge.img+3

Hello,

I have created a check Request form in my system.  For some of our transactions we will deal with multiple transactions but I only want to have one button.  I have created multiple fields (Fee #1, Fee #2, Fee #3, Fee #4, Fee #5). I am trying to create a nested if Statement (or open to other options) to fill the check Request field with the newest fee.  For example If Fee 5 is empty but Fee 4 is not then I want Fee 4 populated in the field.  If Fee 5, 4, and 3 are empty then I want Fee 2 to populate in the field.  And so on.  Appreciate any direction.

 

So far I created a nested if Statement but it only works for the first field then no longer works.

Best answer by ibayub

will it always be in that order? if so you could try the below. alternatively for something more robust you could use a script to get the non empty fee if only 1 will be populated

 

IF(

    {Fee5}, {Fee5},

    IF(

        {Fee4}, {Fee4},

        IF(

            {Fee3}, {Fee3},

            IF(

                {Fee2}, {Fee2},

                IF(

                    {Fee1}, {Fee1}

                )

            )

        )

    )

)

3 replies

ibayub
Forum|alt.badge.img+10
  • Participating Frequently
  • Answer
  • January 13, 2025

will it always be in that order? if so you could try the below. alternatively for something more robust you could use a script to get the non empty fee if only 1 will be populated

 

IF(

    {Fee5}, {Fee5},

    IF(

        {Fee4}, {Fee4},

        IF(

            {Fee3}, {Fee3},

            IF(

                {Fee2}, {Fee2},

                IF(

                    {Fee1}, {Fee1}

                )

            )

        )

    )

)


Forum|alt.badge.img+3
  • Author
  • New Participant
  • January 13, 2025

will it always be in that order? if so you could try the below. alternatively for something more robust you could use a script to get the non empty fee if only 1 will be populated

 

IF(

    {Fee5}, {Fee5},

    IF(

        {Fee4}, {Fee4},

        IF(

            {Fee3}, {Fee3},

            IF(

                {Fee2}, {Fee2},

                IF(

                    {Fee1}, {Fee1}

                )

            )

        )

    )

)


This worked perfect.  Thank you.  The order always stays the same so this works.

 


ibayub
Forum|alt.badge.img+10
  • Participating Frequently
  • January 13, 2025

This worked perfect.  Thank you.  The order always stays the same so this works.

 


my pleasure! 🙂