If, and or

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
A
B
1
10
2
0
3
26

<tbody>
</tbody>
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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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,217,367
Messages
6,136,146
Members
449,994
Latest member
Rocky Mountain High

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