=IF Exact formula stops working part way through

tabbytomo

New Member
Joined
Jun 23, 2016
Messages
18
Afternoon, I have a rather lengthy formula that stops working about half way through. Values 1 Tablet - 27 Tablets work, 1, 2 and 0 boxes work. But 29 - 55 Tablets don't work and I can't understand why!

So if I pop any of the corresponding values in AF, for example 1.9642857142857100, it should return "55 Tablets", but I receive the 'Something has broken' fail message instead.

Excel Formula:
=IF(EXACT(AF3,"0.0357142857142857"),"1 Tablet",IF(EXACT(AF3,"0.0714285714285714"),"2 Tablets",IF(EXACT(AF3,"0.107142857142857"),"3 Tablets",IF(EXACT(AF3,"0.142857142857143"),"4 Tablets",IF(EXACT(AF3,"0.178571428571429"),"5 Tablets",IF(EXACT(AF3,"0.214285714285714"),"6 Tablets",IF(EXACT(AF3,"0.25"),"7 Tablets",IF(EXACT(AF3,"0.285714285714286"),"8 Tablets",IF(EXACT(AF3,"0.321428571428571"),"9 Tablets",IF(EXACT(AF3,"0.357142857142857"),"10 Tablets",IF(EXACT(AF3,"0.392857142857143"),"11 Tablets",IF(EXACT(AF3,"0.428571428571429"),"12 Tablets",IF(EXACT(AF3,"0.464285714285714"),"13 Tablets",IF(EXACT(AF3,"0.5"),"14 Tablets",IF(EXACT(AF3,"0.535714285714286"),"15 Tablets",IF(EXACT(AF3,"0.571428571428571"),"16 Tablets",IF(EXACT(AF3,"0.607142857142857"),"17 Tablets",IF(EXACT(AF3,"0.642857142857143"),"18 Tablets",IF(EXACT(AF3,"0.678571428571429"),"19 Tablets",IF(EXACT(AF3,"0.714285714285714"),"20 Tablets",IF(EXACT(AF3,"0.75"),"21 Tablets",IF(EXACT(AF3,"0.785714285714286"),"22 Tablets",IF(EXACT(AF3,"0.821428571428571"),"23 Tablets",IF(EXACT(AF3,"0.857142857142857"),"24 Tablets",IF(EXACT(AF3,"0.892857142857143"),"25 Tablets",IF(EXACT(AF3,"0.928571428571429"),"26 Tablets",IF(EXACT(AF3,"0.964285714285714"),"27 Tablets",IF(EXACT(AF3,"1.0357142857142900"),"29 Tablets",IF(EXACT(AF3,"1.0714285714285700"),"30 Tablets",IF(EXACT(AF3,"1.1071428571428600"),"31 Tablets",IF(EXACT(AF3,"1.1428571428571400"),"32 Tablets",IF(EXACT(AF3,"1.1785714285714300"),"33 Tablets",IF(EXACT(AF3,"1.21428571428571"),"34 Tablets",IF(EXACT(AF3,"1.2500000000000000"),"35 Tablets",IF(EXACT(AF3,"1.2857142857142900"),"36 Tablets",IF(EXACT(AF3,"1.3214285714285700"),"37 Tablets",IF(EXACT(AF3,"1.3571428571428600"),"38 Tablets",IF(EXACT(AF3,"1.3928571428571400"),"39 Tablets",IF(EXACT(AF3,"1.4285714285714300"),"40 Tablets",IF(EXACT(AF3,"1.4642857142857200"),"41 Tablets",IF(EXACT(AF3,"1.5000000000000000"),"42 Tablets",IF(EXACT(AF3,"1.5357142857142900"),"43 Tablets",IF(EXACT(AF3,"1.5714285714285700"),"44 Tablets",IF(EXACT(AF3,"1.6071428571428600"),"45 Tablets",IF(EXACT(AF3,"1.6428571428571400"),"46 Tablets",IF(EXACT(AF3,"1.6785714285714300"),"47 Tablets",IF(EXACT(AF3,"1.7142857142857200"),"48 Tablets",IF(EXACT(AF3,"1.7500000000000000"),"49 Tablets",IF(EXACT(AF3,"1.7857142857142900"),"50 Tablets",IF(EXACT(AF3,"1.8214285714285700"),"51 Tablets",IF(EXACT(AF3,"1.8571428571428600"),"52 Tablets",IF(EXACT(AF3,"1.8928571428571400"),"53 Tablets",IF(EXACT(AF3,"1.9285714285714300"),"54 
Tablets",IF(EXACT(AF3,"1.9642857142857100"),"55 Tablets",IF(EXACT(AF3,"1"),"1 Box",IF(EXACT(AF3,"2"),"2 Boxes",IF(EXACT(AF3,"0"),"0 Boxes/ Tablets","Something has broken!")))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Your formula searches for text strings. When you enter a value is it a number ( right-aligned in cell when no manual alignment applied) or text ( left aligned)?
In the first case, your cell should be formatted as text
BTW building a small lookup table with one column with values and the other with resulting text would be easier to handle. You just need a VLOOKUP or INDEX/MATCH or XLOOKUP to retrieve your text
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,099
Members
453,021
Latest member
Justyna P

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