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. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
36 minutes ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
48 minutes ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
50 minutes ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
55 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
4 hours, 22 minutes ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
10 hours, 23 minutes ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
20 hours, 43 minutes ago -
Office apps read-only for family members
by
b
23 hours, 19 minutes ago -
Defunct domain for Microsoft account
by
CWBillow
20 hours, 11 minutes ago -
24H2??
by
CWBillow
10 hours, 23 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
4 hours, 37 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
4 hours, 50 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
1 hour, 12 minutes ago -
two pages side by side land scape
by
marc
2 days, 21 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
2 days, 23 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
2 days, 2 hours ago -
Security Essentials or Defender?
by
MalcolmP
2 days, 4 hours ago -
April 2025 updates out
by
Susan Bradley
5 hours, 1 minute ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
1 day, 22 hours ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
1 day, 12 hours ago -
Creating an Index in Word 365
by
CWBillow
2 days, 14 hours ago -
Coming at Word 365 and Table of Contents
by
CWBillow
1 day, 2 hours ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
3 days, 18 hours ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
3 days, 21 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
3 days, 23 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
3 days, 21 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
3 days, 14 hours ago -
I installed Windows 11 24H2
by
Will Fastie
1 day, 21 hours ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
4 days, 2 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
10 minutes 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.