Excel Formula
I have found many useful formulas. An if statement can go on and on. It can be modified and used for other functions. This formula can also be recorded on a when recording a macro.
I have found many useful formulas. An if statement can go on and on. It can be modified and used for other functions. This formula can also be recorded on a when recording a macro.
That IF statement can get confusing LOL
Let’s have a deeper look at it. Here is a basic process of the IF function in Excel
IF(test,then,else)
TEST would be something like A1=B1 although any type of logical test can be applied here. Maybe testing if one cell is the same, greater than, or less than or even NOT EQUAL TO.
The THEN part is returned if the test turns out to be TRUE for example:
If(5<10,”less”,”more”) would return the word LESS
AND
If(10<5,”less”,”more”) would return the word MORE
So you can see that the ELSE part of the IF function is returned when the TEST is false.
Of course in the original post we put a further IF function in the ELSE part to give us more control over what is returned.
Hope that explained it a bit further :)
Correct, Here is another example.
=IF(H1="A",F1+G1,F1-G1)