Rectifying Value Error in Excel to find percentage by extracting dividend/divisor from a single cell having variable length.

Asad Mir

New Member
Joined
Nov 17, 2015
Messages
4
Hi there!


I am having a problem in finding percentage.

In cell B3 I have a text-number string like "Science580/1050", "Arts550/1050", etc respectively. To find percentage by dividing 580 by 1050 I developed a formula copied below. Please note that in above example i.e. "Science580/1050" Line break is inserted right after the word science so i used "char(10)" in the formula. The following function is correctly extracting the numbers 580 and 1050 and divides them using "/" arithmetic operator but regretfully it shows "#Value" error.

=MID($B3,FIND(CHAR(10),$B3,1),FIND("/",$B3)-FIND(CHAR(10),$B3))/RIGHT($B3,LEN($B3)-FIND("/",$B3))


Any help to remove this error and finding percentage using the same formula would highly be appreciated. Anticipating your positive reply. Thank you all.


Regards
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to the board. Try:
Rich (BB code):
=VALUE(MID($B3,FIND(CHAR(10),$B3,1),FIND("/",$B3)-FIND(CHAR(10),$B3)))/VALUE(RIGHT($B3,LEN($B3)-FIND("/",$B3)))
 
Upvote 0
Hi, you are returning the line feed in the first MID() function - try this slight adjustment.

=MID($B3,FIND(CHAR(10),$B3,1)+1,FIND("/",$B3)-FIND(CHAR(10),$B3)-1)/RIGHT($B3,LEN($B3)-FIND("/",$B3))
 
Upvote 0
OMG. Thanks Aloooooooooot. Problem solved. Thanks Thanks Thanks alot. Could you please explain a little about line feed.
 
Upvote 0
Glad it helped :)

Could you please explain a little about line feed.

The Char(10) - so your MID() function returned "Char(10)580" which when divided by "1050" caused the #VALUE error.
 
Upvote 0
.. or with a few less function calls:

=REPLACE(LEFT(B3,FIND("/",B3)-1),1,FIND(CHAR(10),B3),"")/REPLACE(B3,1,FIND("/",B3),"")
 
Upvote 0

Forum statistics

Threads
1,213,521
Messages
6,114,104
Members
448,548
Latest member
harryls

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