If Then Statement

KSCOTT

New Member
Joined
May 20, 2003
Messages
8
I can't seem to get this formula to work. All I need to do is see if the Status column of my table = 70 and the J&R column is not H or J, I need to return the total IOH.

It looks right, however, it's not assigning total IOH if the J&R column is blank.

Formula:

NET RISK2: IIf([ZFREE]![STATUS]=70,IIf([ZFREE]![J&R] Not In ("H","J"),[ZFREE]![TOTAL INV COST]))

I appreciate any help I can get!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi Kscott, you could try to use and if & and function, something like:

NET RISK2: IIf(and([ZFREE]![STATUS]=70,([ZFREE]![J&R] Not In ("H","J")),IOH,[ZFREE]![TOTAL INV COST]))

If this does not work can you please list the name of the columns individualy. Also what do you want to happen if the criteria of your function is false? Thanks
 
Upvote 0
Hi...thank you for replying!

I typed in your formula and it says that the expression contains an invlaid syntax.

Columns:
Status
J&R
Total IOH
Net Risk2 = formula

Net Risk 2= If Status is 70 and J&R is not H or J, then give me the Total IOH, if not leave blank.

Thanks again!
 
Upvote 0
Lets see if this helps.

Net Risk 2: IIf(and([STATUS] = 70, [J&R]<>”h” or “j”),[TOTAL IOH],0)

Let me know.
 
Upvote 0
see if this one works..

Net Risk 2: IIf(([STATUS]=70 and [J&R]<>”h” and [J&R]<> “j”),[TOTAL IOH],0)
 
Upvote 0

Forum statistics

Threads
1,221,528
Messages
6,160,343
Members
451,638
Latest member
MyFlower

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