Forum Discussion

NJ1000's avatar
NJ1000
Copper Contributor
Mar 24, 2020
Solved

Help in data validation formula: Cell cannot equal more than another

In my spreadsheet I need Cell A23 (which has it's value from cells A19:A22) to not be higher than the number already in cell H2 (which has it's value from cells B2:G2).

 

I am using data validation so I can get a warning message to appear.

Here are some formulas I've already tried with no success:

=SUM(A19:A22)<H2

=NOT(A19:A22)>H2

=NOT(A19:A22)>(B2:G2)

 

What formula would I use in data validation to accomplish the rule I need?

  • NJ1000 

     

    Without going down the route of VBA and change events, you could do this with conditional formatting which will not give a message but can allow a message which is not usually visible to be displayed under certain conditions i.e. if cell H23 > H2.........see attached file (I added the formula in H23 adding A19:A22 to demonstrate - to see how it works, change cell A20 from 1000 to zero).

9 Replies

  • Charla74's avatar
    Charla74
    Iron Contributor

    NJ1000

     

    In my spreadsheet I need Cell A23 (which has it's value from cells A19:A22) to not be higher than the number already in cell H2 (which has it's value from cells B2:G2). 

     

    Formula in cell A23 could be:

    =IF(SUM(A19:A22)>H2,H2,SUM(A19:A22))

    • NJ1000's avatar
      NJ1000
      Copper Contributor

      Hey Charla

       

      Thanks for the suggestions. I gave it a shot, but it still allows A23 to be greater than H2.

      • Charla74's avatar
        Charla74
        Iron Contributor

        NJ1000 

         

        Are you able to share the file here (or some sample data if sensitive)?

         

Resources