ignore if cell is blank

Barny72

New Member
Joined
Nov 21, 2024
Messages
5
Office Version
  1. 2016
Platform
  1. MacOS
So I am using this formula to return a value of 1 if true
=IF(a1<b1,1,)
this works but i need it to ignore when a cell is blank - I can't seem to get it right in that respect.

can you help please
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi Barny72,

You don't say what cell you want to check so this will return zero if either A1 or B1 is blank:

Excel Formula:
=IF(OR(LEN(A1)=0,LEN(B1)=0),0,IF(A1<B1,1,0))

Hope that helps.

Regards,

Robert
 
Upvote 0
yeah sorry...so the cell I want to check is b1. A1 will always contain a number but for B1 this is either populated manually with a number or left blank.

hope that helps
 
Upvote 0
Edited: Try this
Book2
ABC
1121
2320
3-20
4-551
580
Sheet1
Cell Formulas
RangeFormula
C1:C5C1=(A1<B1)*(B1<>"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,996
Messages
6,175,862
Members
452,676
Latest member
woodyp

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