Reputation: 165
Excel converts a percentage to a fraction when pasted as a link, e.g. 50% in referenced cell B2 in Sheet1 is shown as 0.5 in linked cell X10 in Sheet2.
However, instead of a percentage, some linked cells in Sheet1 contain text or are empty (there are many workbooks - Sheet1 is a questionnaire).
So a formula like =((('Sheet1'!B2)*100)& "%") & ""
does not work for all cells, because the value might be text (gives a #VALUE
error), and also & ""
does not work for empty cells in this formula.
I need a formula to convert the linked fractions in Sheete to percentages in Sheet2. I have tried with ISNUMBER without success and also do not know how ISNUMBER could be made to work with a text value (yet another nested IF formula, I guess).
Can anyone point to a solution?
Thanks!
CJ
Upvotes: 0
Views: 1730
Reputation: 75840
A simple conditional formatting example below:
Step 1
A2
> Format cells > Number > Custom > 0;-0;;@
0
in cell B2
to test if zeros are no longer displayedStep 2
=B2
in cell A2
Test
in cell B2
to check link and leave itStep 3
A2
> Start > Conditional Formatting > New Rule > Use a Formula > =ISNUMBER(B2)
B2
to test. The conditional formatting rule will overwrite your custom formatting rule when the rule applies e.g. when cell B2
is a number!
Upvotes: 1
Reputation: 34180
I'm not sure if it is worth putting as an answer, but I don't see a problem with
=IF(ISNUMBER(Sheet1!B1),Sheet1!B1,"")
and format the range in Sheet2 starting with B1 as percentage with required number of decimal places.
For conditional formatting, I could only get it to work with
=NOT(ISNUMBER(Sheet1!B1))
and a format of ;;;
EDIT
If you want the text to appear, first formula should be
=IF(Sheet1!B1="","",Sheet1!B1)
or use ;;;@ in above formatting rule.
Upvotes: 0