Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 02-09-2017, 10:11 AM
xor xor is offline Conditional Formatting deleted by excel when saving and reopening file Windows 10 Conditional Formatting deleted by excel when saving and reopening file Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,103
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

I was a bit too quick here. Actually you can omit the double unary minus (--) and get the same result. The formula with -- works fine as you can see, but the same will your original formula =INDEX('Cycle Analysis'!C$3:C$1215,MATCH($B3,'Cycle Analysis'!$B$3:$B$1215,0))="Y". The problem was alone the file type. If you want an explanation of the --, here goes:

Let's say that you have the string ABC123 in A1 and you want to extract 123 (to be used in some calculation). Now you can enter (in B1) the following formula: =Right(A1,3) and get 123. Now try in C1 to enter =ISNUMBER(B1) and you will get FALSE. Try then in C1 to enter =ISTEXT(B1) and you get TRUE. So what appears as a number actually is text which means that you can't use the contents of B1 in a calculation. Now try to put a minus sign just after the equal sign in the formula in B1 so that it becomes =-RIGHT(A1,3). B1 now shows -123 and you will note that C1 (which tested if B1 is text) now shows FALSE. That is, it is now a negative number. Then try to put one more minus sign after the equal sign in the formula in B1 so that it becomes: --RIGHT(A1,3). You will now see the result 123 and observe that C1 still shows FALSE. You can change the formula in C1 to =ISNUMBER(B1) and you will see TRUE. So what is called double unary minus coerces a 'text number' to first a negative number and then to a positive. It is in a way as if you say minus times minus gives plus.
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving as image file removes formatting md61813 PowerPoint 0 03-01-2016 03:23 PM
A text box (active X) control doesn't work on reopening the file Chris Baker PowerPoint 1 06-07-2013 05:51 AM
Saving & reopening comparison MarshallAbrams Word 0 03-29-2012 06:19 AM
Conditional Formatting Problem Excel 2007 namedujour Excel 6 08-04-2011 10:52 AM
Conditional Formatting deleted by excel when saving and reopening file Conditional formatting of cell, Excel 2003 Scaffold Excel 2 05-01-2010 08:56 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft