Good morning everybody!
I have the following problem. I have two files, one with the ‘raw’ data as I call it, and the second one is linked to the first one, with the report in a nice and presentable format.
As I am working with % change data in some columns of my report, sometimes, depending on my values I have -100. Somebody asked me if I can replace the -100 with NA (not available), it would just look better, she said. Now, I can only make modifications to the linked file, I cannot touch the original file with the ‘raw’ data.
I was thinking in the lines of an IF formula in each cell, which would work, but this solution is very very tedious and long, as I am working with practically hundreds of cells like these, scattered across 10-12 sheets. It would take me ages to input this formula in every cell, even if I could drag down the formula to other cells below. Also my link looks like this for example:
=’D:seriesClientCountryCategory[rawdata.xls]Total’!F7 . If I will use an IF formula, it will become also very, very long:
=if(=’D:seriesClientCountryCategory[rawdata.xls]Total’!F7 =-100, ‘NA’, ‘D:seriesClientCountryCategory[rawdata.xls]Total’!F7).
Can anyone think of an easier way to accomplish this?
I also thought of a macro, which searches for -100 and replaces them with NA’s, but for that I need to have real values, not links in my file.
Any help, hints very welcome and appreciated.
K.
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Links and replace data (Excel 97)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Links and replace data (Excel 97)
- This topic has 18 replies, 8 voices, and was last updated 23 years, 6 months ago.
AuthorTopicWSKislany
AskWoody LoungerOctober 17, 2001 at 5:50 am #361618Viewing 2 reply threadsAuthorReplies-
WSpieterse
AskWoody Lounger -
WSKislany
AskWoody Lounger -
WSpieterse
AskWoody LoungerOctober 17, 2001 at 7:41 am #547180What about this macro:
Option Explicit
Sub MakeIfs()
Dim rCell As Range
Dim sOldFormula As String
Dim sNewFormula As String
Dim sElse As String
Dim sCondition As String
sCondition = “=-100”
sElse = “””NA”””
For Each rCell In ActiveSheet.UsedRange.Cells
sOldFormula = rCell.Formula
If Left(sOldFormula, 1) = “=” Then
sOldFormula = Right(sOldFormula, Len(sOldFormula) – 1)
sNewFormula = “=IF(” & sOldFormula _
& sCondition & “,” & sElse & “,” & sOldFormula & “)”
rCell.Formula = sNewFormula
End If
Next
End Sub
-
-
-
WSGlennB
AskWoody LoungerOctober 17, 2001 at 7:36 am #547179Use a custom number format to display -100 as NA. Choose menu command Format/Cells and click the Number tab, and select Category “Custom” from the list on the left hand side, and then in the Type input box type this :
[=-100]”NA”;#0
and click the OK button, and that should do what you want.Glenn Bumford
-
WSWebGenii
AskWoody Lounger -
WSKislany
AskWoody LoungerOctober 17, 2001 at 2:07 pm #547238Thanks for all your responses, they are very useful. I think, however, the the best one that suits my needs is the custom cell formatting, because it seems the easiest solution from all. I will keep the macro in my list of useful macros, but for now, I simply took the formatting given and modified it to also show the negative numbers with red font and in brackets. I have a very minor problem with it though, that even the 0 is shown as negative now. I can’t figure out why… Can you please help me again?
Here is what I did so far:
#,##0;[=-100]”NA”;(#,##0)Thanks again for all your help.
K. -
WSWebGenii
AskWoody LoungerOctober 17, 2001 at 2:24 pm #547239Try this
#,##0;[=-100]”NA”;GeneralFor those following this thread –
you have 4 settings you can control in a custom format, each setting is separated from the others by a semicolon.
first position is for positive number format;second position is for negative number format;third position is for zero;fourth position is for text.Cheers
-
WSJohnBF
AskWoody LoungerOctober 17, 2001 at 2:49 pm #547241#,##0_);[=-100]”N/A”;0_; also works. He needed to remove the red formatting from the last argument, and he loses ability to further format negative numbers. Personally I’d go for using NA() somewhere in the formula.
I didn’t know you can use text names like that! It’s not in Help. But “General” seems to be the only one that works in XL97; are there others?
-
WSWebGenii
AskWoody Lounger
-
-
-
WSGlennB
AskWoody LoungerOctober 17, 2001 at 4:29 pm #547255You can have more than one section with a clause in it. Try this
[=-100]”NA”;[ red ][<0](#,##0);#,##0_)
which will make your negatives red with brackets round. ( Leave the spaces out of [ red ], as I've done this to stop it being mistaken for a posting font control string. )Glenn Bumford
-
WSJohnBF
AskWoody LoungerOctober 17, 2001 at 3:59 pm #547260I see what the problem is; when you put [ red ] in -without- the spaces, the Lounge is interpreting it as turning the post message font red. So for custom formats in Excel your posted word [ red ] is not showing up. Put in spaces like I have here, then tell everyone not to use the spaces in Excel.
-
WSGlennB
AskWoody LoungerOctober 17, 2001 at 4:34 pm #547266Thanks John, have edited my posting now, so should make more sense.
Anyway, the rules for conditions of your own in Custom Formats is very similar to the standard, except that when you create conditions the rules go something like
[condition 1]number format 1 ; [condition 2]number format 2;number format 3;text
where number format 3 is applied to cells that fail conditions 1 and 2.Glenn Bumford
-
WSJohnBF
AskWoody LoungerOctober 17, 2001 at 4:57 pm #547269This is a cool tip Glenn. In playing with it in XL97, it appears that 1. there can only be one “conditional” format per custom format argument and 2. we are restricted to the standard four arguments (pos, neg, zero, text); therefore we can’t use multiple conditional formats for any particular one (of the four) format argument sets. Or am I missing something?
-
WSGlennB
AskWoody LoungerOctober 17, 2001 at 5:09 pm #547270
-
-
-
WSAndrew Cronnolly
AskWoody LoungerOctober 18, 2001 at 7:42 am #547285Does [>=0]#,##0;[=-100]”NA”;[ red] (#,##0) help ?
Whilst the formatting sections cover Positive, Negative,Zero and text under normal circumstances, in effect the thgird section applies to any numbers not covered by either the first or second sections, so that if conditions apply to those it could upset what the third section applies to.
Andrew C
-
-
-
WSMichael Evans
AskWoody LoungerOctober 17, 2001 at 10:19 pm #547333Though others have solved your problem, the following is sometimes useful. An alternative to filling down &/or across is to select all the cells you want the formula entered in, type the formula in the formula bar, then hold down Ctrl and press Enter, this enters the formula in all the selected cells. It works on multiple selections.
-
WSKislany
AskWoody Lounger -
WSColinBurrows
AskWoody LoungerOctober 18, 2001 at 11:42 am #547417I find I use this all the time. 9 times out of 10 I want to copy the formula but not the formatting. Usually the formula is already entered, so I use a minor variation. Select all the cells, including the source cell with the formula to be copied (the source cell should be the active cell.) Press F2, then Control+Enter. Effectively it’s equivalent to Control D or Control R (copy down or copy right), except the formatting isn’t copied.
-
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Solid color background slows Windows 7 login
by
Alex5723
1 hour, 4 minutes ago -
Windows 11, version 24H2 might not download via Windows Server Updates Services
by
Alex5723
1 hour, 32 minutes ago -
Security fixes for Firefox
by
Susan Bradley
3 hours, 8 minutes ago -
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
2 hours, 55 minutes ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
12 hours ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
3 hours ago -
Return of the brain dead FF sidebar
by
EricB
9 hours, 2 minutes ago -
windows settings managed by your organization
by
WSDavidO61
13 hours, 7 minutes ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
27 minutes ago -
The local account tax
by
Susan Bradley
4 hours, 41 minutes ago -
Recall is back with KB5055627(OS Build 26100.3915) Preview
by
Alex5723
1 day, 1 hour ago -
Digital TV Antenna Recommendation
by
Win7and10
17 hours, 33 minutes ago -
Server 2019 Domain Controllers broken by updates
by
MP Support
1 day, 12 hours ago -
Google won’t remove 3rd party cookies in Chrome as promised
by
Alex5723
1 day, 14 hours ago -
Microsoft Manager Says macOS Is Better Than Windows 11
by
Alex5723
1 day, 17 hours ago -
Outlook (NEW) Getting really Pushy
by
RetiredGeek
20 hours, 10 minutes ago -
Steps to take before updating to 24H2
by
Susan Bradley
11 hours ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
1 day ago -
Replacing Skype
by
Peter Deegan
13 hours, 10 minutes ago -
FileOptimizer — Over 90 tools working together to squish your files
by
Deanna McElveen
1 day, 11 hours ago -
Excel Macro — ask for filename to be saved
by
nhsj
9 hours, 6 minutes ago -
Trying to backup Win 10 computer to iCloud
by
SheltieMom
12 hours, 56 minutes ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
3 days, 17 hours ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
3 days, 19 hours ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
3 days, 19 hours ago -
No April cumulative update for Win 11 23H2?
by
Peobody
2 days, 7 hours ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
3 days, 20 hours ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
4 days, 11 hours ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
5 hours, 4 minutes ago -
Inetpub can be tricked
by
Susan Bradley
2 days, 22 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.