Error Check Formula

jimmyaja123

New Member
Joined
Jan 6, 2021
Messages
14
Office Version
  1. 365
Platform
  1. Windows
I have created an error check formula based on character length limit in another cell 'E2, G2' etc, image example provided

=+IF(OR(LEN($E20)=$E$2,"OK",LEN($G20)=$G$2,"OK",LEN($N20)<=$N$2,"OK",LEN($I20)<=$I$2,"OK",LEN($L20)<=$L$2,"OK",LEN($P20)<=$P$2,"OK",LEN($R20)<=$R$2,"OK"),"Error")

The problem i'm having is even if the character limit is not passed, the final result always says 'Error'? Is there something i've written incorrectly in the formula?
Capture.PNG
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
not sure your OR() is correct

=+IF(OR(LEN($E20)=$E$2,"OK",LEN($G20)=$G$2,"OK",LEN($N20)<=$N$2,"OK",LEN($I20)<=$I$2,"OK",LEN($L20)<=$L$2,"OK",LEN($P20)<=$P$2,"OK",LEN($R20)<=$R$2,"OK"),"Error")

OR(LEN($E20)=$E$2,"OK",LEN($G20)=$G$2,"OK",LEN($N20)<=$N$2,"OK",LEN($I20)<=$I$2,"OK",LEN($L20)<=$L$2,"OK",LEN($P20)<=$P$2,"OK",LEN($R20)<=$R$2,"OK")

should it be
OR(LEN($E20)=$E$2,LEN($G20)=$G$2,LEN($N20)<=$N$2,LEN($I20)<=$I$2,LEN($L20)<=$L$2,LEN($P20)<=$P$2,LEN($R20)<=$R$2)

AND then
IF ( OR(LEN($E20)=$E$2,LEN($G20)=$G$2,LEN($N20)<=$N$2,LEN($I20)<=$I$2,LEN($L20)<=$L$2,LEN($P20)<=$P$2,LEN($R20)<=$R$2) , "OK", "ERROR")
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

You have not explained exactly what you want the formula to do, but my guess is this.

Excel Formula:
=IF(OR(LEN($E20)=$E$2,LEN($G20)=$G$2,LEN($N20)<=$N$2,,LEN($I20)<=$I$2,LEN($L20)<=$L$2,LEN($P20)<=$P$2,LEN($R20)<=$R$2,),"OK","Error")
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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