Round formula containing text

Ironman

Well-known Member
Joined
Jan 31, 2004
Messages
1,069
Office Version
  1. 365
Platform
  1. Windows
Hi

Cell F1 contains a heading with a formula in the format "COMMENTS (0.000000000000% CONVERTED)".

The formula is
Excel Formula:
="COMMENTS ("& ((MAX(IF(B2:B6210<>"",ROW(2:6210))))/6210)*100 & "% CONVERTED)"
and divides the last used row number in Col B by 6210.

All I'm looking for is a way to round the formula result to the nearest whole number instead of 12 decimal places e.g. COMMENTS (38% COMPLETED). I can't use ROUND because I get a circular reference and using number format makes no difference.

Many thanks!
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Maybe:
Excel Formula:
="COMMENTS ("&ROUND(((MAX(IF(B2:B6210<>"",ROW(2:6210))))/6210)*100,0) & "% CONVERTED)"
 
Upvote 0
Solution
Change it to: (Ctrl-Shift_enter for Ex2016 or earlier)
Code:
="COMMENTS ("& ROUND(((MAX(IF(B2:B6210<>"",ROW(2:6210))))/6210)*100,0) & "% CONVERTED)"

Or faster with alternative non-array version (Enter only)
Code:
="COMMENTS ("& ROUND(LOOKUP(2,1/(B2:B6210<>""),ROW(B2:B6210))/6210,0)& "% CONVERTED)"
 
Upvote 0
Many thanks Joe and bebo, that worked perfectly!
(@Bebo - your non-array version returned 0%)
 
Upvote 0
="COMMENTS ("& ROUND((LOOKUP(2,1/(B2:B6210<>""),ROW(B2:B6210))/6210)*100,0)& "% CONVERTED)"
Yes, that works fine too - thanks again bebo!
 
Upvote 0
While you're there, can I just ask if there's a way I can create a link to this part of the formula
Excel Formula:
LOOKUP(2,1/(B2:B6210<>""),ROW(B2:B6210))/6210
i.e. go to the first empty cell in the column?
 
Upvote 0
While you're there, can I just ask if there's a way I can create a link to this part of the formula
Excel Formula:
LOOKUP(2,1/(B2:B6210<>""),ROW(B2:B6210))/6210
i.e. go to the first empty cell in the column?
Nope. Go to last non-empty cell then get the row index
 
Upvote 0
OK thanks - I'll post separately for a VBA solution with a selection_change event, which I think should be possible.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,272
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top