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
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,701
Office Version
  1. 365
Platform
  1. Windows
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)))
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,465
Office Version
  1. 365
Platform
  1. Windows
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))
 

Asad Mir

New Member
Joined
Nov 17, 2015
Messages
4

ADVERTISEMENT

OMG. Thanks Aloooooooooot. Problem solved. Thanks Thanks Thanks alot. Could you please explain a little about line feed.
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,465
Office Version
  1. 365
Platform
  1. Windows
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.
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
47,926
Office Version
  1. 365
Platform
  1. Windows
.. or with a few less function calls:

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

Watch MrExcel Video

Forum statistics

Threads
1,122,892
Messages
5,598,693
Members
414,254
Latest member
MarieCo

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
Top