If, and or

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[TD]10
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]26
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
A1 = blank (but not empty as it has " ")
B1 = number

A2 = 0
B2 = empty

A3 = 26
B3 = empty

I am trying to write IF statement: if A1, A2 etc is a number and =0 OR B1, B2 etc is blank (empty) then delete row.

In table above I should have C1 = Keep C2 = Delete C3 = Keep

I am tying =IF(AND(OR(ISNUMBER(A1),A1=0,ISBLANK(B1)),"Keep","Delete"), however my results are the other way around. Don't know how to correct.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Just switch the keep/delete around :)

Code:
=IF(OR(AND(ISNUMBER(A1),A1=0),ISBLANK(B1)),"Delete","Keep")

WBD
 
Upvote 0
If I do that, then I get 'Delete' in C2 whereas I should have 'Keep'
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,215
Members
453,024
Latest member
Wingit77

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