Query iif statement

MattC66

New Member
Joined
Apr 3, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi All - new here so be kind.
I am trying to set the cell that if it doesn't have an OrderNum then the field is says NO. However when I run it - it shows NO on every line.

Room: IIf(IsNull([OrderNum])=Null,Null,"NO")
Background I have two tables. One with all Orders and one with Orders that contain a product called Rooms. I want a list that shows all the orders and column that has a NO (ideally a check box if it has a room). but I couldn't find a way to do a positive. So I figured I'd just not all orders without a room on the order show "NO".

Thanks in advance.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
SQL:
IIf([OrderNum] IS NULL,NULL,"NO")

IsNull is a VBA function that returns a boolean (true/false) value. To check if a field is null, you just use IS NULL.
 
Upvote 0
Answer given and accepted yesterday at
 
Upvote 0
Solution
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: iif statement help change to yes or no or a check box.
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Not sure how to mark the problem as solved. Yes the above responses solved it.
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,685
Members
449,463
Latest member
Jojomen56

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