Cell to be colored according to expiration date

malokran230560 Posted messages 7 Status Member -  
tyranausor Posted messages 3501 Registration date   Status Member Last intervention   -
Hello
I would like to highlight different colors for cells containing expiration dates based on certain criteria
GREEN: the product is consumable and has not reached the expiration date
YELLOW: the product is consumable but the expiration date will be reached in 2 months
ORANGE: the expiration date has been reached
RED: the expiration date of the product is exceeded by 2 months

and/or

GREEN: the expiration date of the product is not exceeded
ORANGE: the expiration date of the product is less than 2 months
RED: the expiration date of the product is more than 2 months

and/or

GREEN: the expiration date of the product is not exceeded
ORANGE: the expiration date of the product is less than or equal to 2 months
RED: the expiration date of the product is more than 2 months

Can you help me by providing details on how to construct the formulas... I am always eager to learn but I wasn't born with IT knowledge... thank you very much for your valuable help

4 answers

  1. Mike-31 Posted messages 18405 Registration date   Status Contributor Last intervention   5 147
     
    Good evening,

    Yes, Libre Office and Open Office have the same operating criteria and are compatible; however, Conditional Formatting is different from Microsoft Office.

    I would recommend starting by creating three styles: Red, Yellow or Orange, and Green.
    The simplest and quickest way is to color a blank cell, for example G5, in red and Format/Styles/New Style
    give it a easily identifiable name later, for example Red
    then recolor the cell in yellow and do Format/Styles/New Style
    give it a easily identifiable name later, for example Yellow
    and the same for Green
    delete the colored cell that is no longer needed.

    Then select the range of reference dates, for example E2:E50

    Format/Conditional Formatting and select Manage
    in the assistant click on Add
    then select The formula is paste this formula F2>=TODAY()+60
    Apply the style select Red

    Add
    then select The formula is paste this formula AND(F2<TODAY()+60;F2>TODAY())
    Apply the style select Yellow

    Add
    then select The formula is paste this formula AND(F2<>"";F2<=TODAY())
    Apply the style select Green

    https://www.cjoint.com/c/HIwsMOOL3Aj
    See you later
    Mike-31

    I am responsible for what I say, not for what you understand...
    1
  2. PapyLuc51 Posted messages 4569 Registration date   Status Member Last intervention   1 511
     
    Hello,

    One detail is missing; is it on OpenOffice or LibreOffice?

    Is it possible to have a copy of the file (without confidential data) using cjoint - please copy the provided link and paste it in the response.

    Best regards
    0
    1. tyranausor Posted messages 3501 Registration date   Status Member Last intervention   2 060
       
      Hello PapyLuc51, these two sequences look similar and I think the conditional formats are the same in the spreadsheet.
      0
      1. PapyLuc51 Posted messages 4569 Registration date   Status Member Last intervention   1 511 > tyranausor Posted messages 3501 Registration date   Status Member Last intervention  
         
        Hello Tyranausor, indeed the MFCs are implemented the same way on both spreadsheets, but if I remember correctly, in OpenOffice you cannot have more than 3 in the same cell; so it's not possible for the first case requested.

        Best regards
        0
  3. Mike-31 Posted messages 18405 Registration date   Status Contributor Last intervention   5 147
     
    Re the thread,

    For enthusiasts of strict spreadsheet rules, it is quite possible to bypass numerical difficulties regardless of spreadsheets and seniority
    more difficult for value ranges but very easy for fixed data
    example on the attached file and in a single condition on Open Office or Libre Office, just create the styles as explained in my previous post and create a small database with the reference value in one cell and the style name in another, for example in M2:N10 where you can add 4 styles between M7 and N10

    select the range to be processed, for example K5:K25 and apply this conditional formula
    STYLE(VLOOKUP(K5;$Sheet1.$M$2:$N$10;2;0))
    in Apply the default selected style
    and that's it
    https://www.cjoint.com/c/HIxfTYnqp0j

    --
    A+
    Mike-31

    I am responsible for what I say, not for what you understand...
    0
    1. PapyLuc51 Posted messages 4569 Registration date   Status Member Last intervention   1 511
       
      Thank you, I wasn't aware of this way to achieve it. I will keep your demonstration in my tablets.

      Best regards
      0
    2. malokran230560 Posted messages 7 Status Member
       
      Thank you to Mike, thank you to PapyLuc51, thank you to Tyranausor... I'm going to see how it goes... have a very good Sunday and once again a big thank you for your valuable help.
      0
    3. malokran230560 Posted messages 7 Status Member
       
      However, the opening of the file is not going well
      here's a sample of what I'm getting... not easy to exploit...
      `�ՌœC��"/�)��4��6�]�������y&��T���Se�e���]�g|R�9���+��]K`Te��T�<!�2U�b��z���V�5�f'|C��v����q����q���)_��pzP�+�ŒPV�ov��*�5K�p����0�rs�6/[^4�-��g�^����-A���S�ul��J�ӻm�4����i��N��2H��X��

      ���d�J���44+����ʥ^5�XIn��'���t���|��Bqua�9K�*�o�uj��g�ʝ3"|׌@��8_��W
      �Zyb~D�}J�K��$�m��&ߟ�?���?�pj�4�ފaʽ�œoP�7bo/��"��n��p6>����qv9h[8Ƹ����1֝����D����hи� �]˜@�ӇA�J�A��k��[��Ǯne�WG���F���`Yj�&ɦec��g����lme�r!e��F�Gs-$�B�3������^%ɖQ�]Ai�@F�� � �وʁ��(F�}�.̶
      �� m]J%���u9�����wu�� �w�U:��5jk��>������:V�6}zkDB�r�-�����.s�ň�t�P��2
      �~U������,v�A'�5rZ_(��*����b8�=���j��b�
      
      ��R�l8z�!��מs}�-���koy].��1���j����bGč���N��-C9!K~�̑Y���}�
      ������Д���o ��|��!8�ą���w��C\O��]����†��
      �;a�{B6��5�Jx{X�9ap�niT�W%�b��c*��VI`�?A��*�I
      �u�-F7)��1>]� ����q�3;�i���x�p���] �\~:At�0��a��!{�/M����A����d��S���tk��$h��G���uO3x�<:����]�cHY.N�[p�,t�$$z���$�@S��}R�+�~����w��XG��(J�;8� ��9?�[;��
      0
    4. Mike-31 Posted messages 18405 Registration date   Status Contributor Last intervention   5 147
       
      Re,

      It's strange which software you are working with.
      0
    5. tyranausor Posted messages 3501 Registration date   Status Member Last intervention   2 060
       
      Hello, malokran230560, right-click and "Save target as" to download the ods file. Thank you, Mike-31.
      0
  4. Mike-31 Posted messages 18405 Registration date   Status Contributor Last intervention   5 147
     
    The forum is a treasure trove of knowledge and exchange, a pleasure to encounter different insights, too bad that sometimes both requesters and contributors forget certain elementary rules.

    I have also written a tip that may interest you for bypassing the limit on conditional nesting, but it has not been tested on Open Office here

    See you
    Mike-31

    I am responsible for what I say, not for what you understand...
    0