Forum Discussion
andrew_jmdata9
Feb 21, 2019Copper Contributor
Bar length in cell based on value in another cell
Hi, We have a report where a column shows a value, usually between 1 and 200. We want to have a horizontal bar in the next cell whose length is based on the cell value. Something like below,...
- Feb 21, 2019Let me correct myself. The formula in B2 should be:
=REPT(“|”,MIN(A2,99)&
IF(A2>99,
“X”&REPT(“|”,A2-100),
“”)
andrew_jmdata9
Feb 21, 2019Copper Contributor
Hi Sergei, That's what I want. Any idea how to improve on the "X" and so I get continuous bar?
Thanks
Andrew
Twifoo
Feb 21, 2019Silver Contributor
Swap the “X” with “|” in Sergei’s formula. For another, instead of -100, modify it to 101 so that the 100th character will display as “X”, all succeeding characters will display as “|”, and the total number of characters will be exactly equal as those of A2.
- TwifooFeb 21, 2019Silver ContributorLet me correct myself. The formula in B2 should be:
=REPT(“|”,MIN(A2,99)&
IF(A2>99,
“X”&REPT(“|”,A2-100),
“”)- andrew_jmdata9Feb 21, 2019Copper ContributorThanks all!