MS Excel Help - Saturation Points ?

Click For Summary

Discussion Overview

The discussion revolves around using Excel to analyze inflow and outflow in a tank, specifically focusing on how to prevent negative volume values when the tank is empty. Participants explore various methods, including IF statements and other functions, to achieve this goal.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests using an IF statement to ensure that the volume does not go below zero, proposing the formula =IF(cell_reference < 0, 0, cell_reference).
  • Another participant mentions the use of the floor function but later corrects themselves, indicating that an IF statement would be more appropriate.
  • A different participant provides a standard IF() function example, emphasizing the need to reference the cell displaying the tank volume.
  • Some participants discuss the use of VBA for more complex IF-THEN-ELSE statements, suggesting that it allows for nested statements and loops.
  • There is a suggestion that using =MAX(0, [formula here]) could be a simpler solution than an IF statement in this context.
  • One participant expresses uncertainty about their volume calculations and indicates they need to review their Excel model later.
  • Another participant notes that the Excel command includes an "else" condition as the third term in the IF statement, but acknowledges the need for more specifics to fully understand the problem.

Areas of Agreement / Disagreement

Participants present multiple competing views on the best approach to handle the problem, with no consensus reached on a single solution. Some advocate for the use of IF statements, while others suggest alternatives like the MAX function or VBA.

Contextual Notes

Participants express varying levels of familiarity with Excel functions and the specifics of the volume calculations, which may affect their proposed solutions.

ko_kidd
Messages
21
Reaction score
0
MS Excel Help -- Saturation Points ?!

Does anyone know how to do this with if-then statements or something else?

For example:

I want to analyze inflow and outflow in a tank, when the volume reaches zero then it's empty of course--so I shouldn't have a negative volume after this, volume should just be zero until I can finally get a large enough inflow. Say I'm doing this in minutes.
 
Computer science news on Phys.org
Sounds like the floor function in Excel would do what you want. Try help floor.
 
berkeman said:
Sounds like the floor function in Excel would do what you want. Try help floor.

Oops, no. Foor is different. Using an IF statement would probably be best.
 
Excel Help said:
=IF(logical_test,value_if_true,value_if_false)


So use =IF(cell_reference < 0, 0, cell_reference)

Here are two columns of numbers: The first is just the numbers, and the second column uses the above equation in each cell, with the cell_reference equal to the cell to its left. Just use control-d to pull the first cell equation down to all the cells in the right column to get the calculations done.

Code:
10	10
9	9
8	8
7	7
6	6
5	5
4	4
3	3
2	2
1	1
0	0
-1	0
-2	0
-3	0
-4	0
-5	0
-6	0
 
Last edited:
I'm not sure what your volume calcs look like, but a standard IF() function in Excel would look like:

IF(A1>0,ENTER CALC HERE,0) where A1 is the cell that would display the tank volume.
 
You have to use VBA in Excel to use the full IF-THEN-ELSE statement.

IF dummy > 10 THEN
msgbox "dummy is greater than 10"
ELSE
msgbox "dummy is less than or equal to 10"
END IF


I'm not sure what you are asking about the rest of the question.
 
No, the excel command contains the "else". It's the 3rd term in Fred's statement.

Also, my read of the question says that both the first and second terms should be the equation - first as an argument, then as an output. Ie:

=if([your function]>0,[your function],0)

But it is tough to know for sure without getting more specifics of the problem.
 
russ_watters said:
No, the excel command contains the "else". It's the 3rd term in Fred's statement.

Never said it wasn't.

My comment was that if you want to use the full functionality to use VBA. That way you can use nested statements (a lot easier anyway), plus loops, etc... It just depends on how complicated your calculation is (or what ever you need the app to do).

If you need just one simple If-Then-Else statement, then of course the Excel function IF() would work just fine.
 
I guess berkeman's solution makes sense, I have to look at my excel model *later* and see if that would work. Thanks.
 
  • #10
Here's a stripped down version of the stuff I was working on.

It's a model of the volume in a tank, ignoring how a real tank's outflow would change with the amount of mass in the tank.
 
Last edited by a moderator:
  • #11
In this particular case the IF statement is overkill. You could just use
=MAX(0, [formula here])
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 49 ·
2
Replies
49
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 109 ·
4
Replies
109
Views
9K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K