If-then order standards

mrblister

Board Regular
Joined
Nov 20, 2016
Messages
200
Office Version
  1. 2021
Platform
  1. Windows
In Excel, for the formula: "IF(logical_test, value_if_true, value_if_false)"

Are there standards, OR are there efficiency rules, etcetera, that determine the BETTER version of the direction of the logical_test and the value_if_true/false?

For example, let's say the outcome of cell B1 is determined by whether cell A1 is blank (or not). So of the options:
  1. IF(A1="", "HELLO", "HI")
  2. IF(A1<>"", "HI", "HELLO")
Which one of those options is better to use? And in what circumstances?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
In Excel, for the formula: "IF(logical_test, value_if_true, value_if_false)"

Are there standards, OR are there efficiency rules, etcetera, that determine the BETTER version of the direction of the logical_test and the value_if_true/false?

For example, let's say the outcome of cell B1 is determined by whether cell A1 is blank (or not). So of the options:
  1. IF(A1="", "HELLO", "HI")
  2. IF(A1<>"", "HI", "HELLO")
Which one of those options is better to use? And in what circumstances?
I prefer the first method.

I always think that it is best to test is something is the case rather than testing if it is not the case.

When you have embedded IF statements then method 1 will be clearer to the reader.
 
Upvote 0

Forum statistics

Threads
1,224,900
Messages
6,181,631
Members
453,059
Latest member
jkevin

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