Get error message for negative numbers

sf1221

New Member
Joined
Sep 12, 2022
Messages
2
Office Version
  1. 2003 or older
Platform
  1. Windows
I have a spreadsheet that contains a bed count for a facility. This is for scheduling purposes to ensure we do not overbook our clients, the row in question sums up the previous days "beds available count" and subtracts the (new intakes minus the discharges) to keep the beds available count accurate. The formula looks like this =(C38)-((E20)-(E37)) (C has the previous days bed available, and E20 has intakes, E37 has discharges) and the rows obviously change as it goes down the line of days. I am trying to create a rule that prevents me from adding any counts into our intake section that would make this formula in any of the cells go into the negatives. I want an error message to pop up that literally prevents me from adding a person that might make any of those formulas going forward go into the negatives to make sure we never overbook. I tried adding a data violation for that row to show an error message for anything less that 0 but it didn't do anything because I then tried to force an error on a random day and the numbers just showed negative going forward. I would love some help on this!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
You showed a formula, but data validation has to be applied to cells where you enter data. Where are you entering data? Can you show us a table or at least a screen shot of what your sheet layout looks like? I followed most of your explanation but got lost on the last line where you explained why your data validation didn't do anything.

BTW that formula has superfluous parentheses. It could be written as
Excel Formula:
=C38 - (E20 - E37)
and even further simplified to
Excel Formula:
=C38 - E20 + E37
 
Upvote 0
Here is a screen shot. the count column has numbers that are then summed into the beds available with the formula I posted. It makes sense that data validation doesn't work because they are all formulas in this row (except the blanks), so is there another way to make sure the entire "beds available" row doesn't allow you to enter a count into the intakes that then causes the "beds available" for each day to go into the negatives? for example, a "beds available" cell for a certain day may say 5 so I go ahead a add an intake however if I already have 5 intakes on a future day this is then an error because it will cause that future day to go into the negatives causing an overbook. I have been able to set a conditional format so at lease those cells turn red (I am attaching another screenshot of what that looks like) however I would really like to get an actual error message preventing me from even entering a count into a day if it causes negatives on a future day because sometimes it might ne a day that is farther ahead than I see on the screen.
 

Attachments

  • Screenshot (9).png
    Screenshot (9).png
    146.9 KB · Views: 6
  • Screenshot (11).png
    Screenshot (11).png
    149.1 KB · Views: 6
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,115
Members
452,545
Latest member
boybenqn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top