• Resolved mbhm1

    (@mbhm1)


    I have created the following multiple conditions for a table cell in TablePress, but am getting an error message.

    If cell b3 is greater than 19 but less than 31, return cell 164, otherwise if cell b3 is greater than 30 but less than 41, return cell i74, and so on:

    =IF(31>B3>19,I64, IF(41>B3>30,I74, IF(51>B3>40,I84, IF(61>B3>50,I94, IF(71>B3>60,I104, IF(81>B3>70,I114, IF(90>B3>80,I124)))))))

    The message I get is: ERROR illegal character ‘&’

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Are you getting this error on the actual page where you embedded the table? I have seen that error when using the “Preview” of a table (as that’s handled slightly different, for technical reasons), but I have not yet seen it on the actual page where the Shortcode for the table was added.

    Regards,
    Tobias

    Thread Starter mbhm1

    (@mbhm1)

    Sorry, I was getting that message on the ‘Preview’ of a table.

    When I embed the shortcode on the page, I get this error message:

    !ERROR! wrong number of arguments (1 given, 3 expected)

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    I’m not sure, but it might be the last IF in your equation. That seems to be lacking a parameter.

    Regards,
    Tobias

    Thread Starter mbhm1

    (@mbhm1)

    I have tried all sorts of permutations and comibinations, with no luck. Is it possible that multiple conditions do not work with this plugin?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    what’s the last version of the formula you tried?
    In your example in the original post, the most inner IF(90>B3>80,I124) is likely the culprit. That’s missing a parameter (for the “false” case).

    Regards,
    Tobias

    Thread Starter mbhm1

    (@mbhm1)

    Great – that solved that problem (my apologies for not picking up that error myself), and I no longer get any error message. However, no matter what number value is put in cell B3, the formula as written always picks up the number in cell I64. For example, if the number in cell B3 is 58, it should pick up the number in cell I94 (ie 58 is >50 but <61) but instead it is picking up the number in cell I64, which is the first condition, which is clearly not being met. If I change the number in cell B3 to 64, it still picks up the number in cell I64.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    good to hear that the error is gone now!
    Can you maybe export your table to a CSV file and email that to me (the address is in the main plugin file “tablepress.php), so that I can test a few things myself?

    Regards,
    Tobias

    Thread Starter mbhm1

    (@mbhm1)

    Done – thanks.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks! I have received the email and will take a look asap!

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Mark,

    I checked the formulas with your file again, and found (a bit embarresing for me) that such two-way comparisons are indeed not possible as in

    IF( 50<B3<60, 1, 0 )
    

    Instead, we’ll have to write these using the AND() function:

    IF( AND( 50<B3, B3<55 ), 1, 0 )
    

    So, both comparisons have to be written separately, and combined with the AND() function (which returns true if all arguments (single comparisons) are true).

    Can you maybe try again with that approach?

    Regards,
    Tobias

    Thread Starter mbhm1

    (@mbhm1)

    It is working perfectly – thank you! Interestingly, that is what is required in excel also, but I had removed it here at the beginning thinking it was not required.

    Again, many thanks!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    awesome! Thanks for the confirmation!
    Good to hear that it’s working now! ??

    Best wishes,
    Tobias

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Attempting to Resolve Multiple Conditions’ is closed to new replies.