Help with existing formula

spectraflame

Well-known Member
Joined
Dec 18, 2002
Messages
821
Office Version
  1. 365
Platform
  1. Windows
The following formula is in an existing spreadsheet that I need to better understand. I think this formula is searching a specific cell to look for a "/". When it is found, it subtracts the number to the left of the slash from the other number.

=IF(ISERROR(FIND("/",D19)),0,MID(D19,FIND("/",D19)+1,255)-LEFT(D19,FIND("/",D19)-1))

What I do not understand is what 1,255 is and what is for. When I key in 55/100 in cell D19, the result is 45. Just do not understand why 1,255 is necessary.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

63falcondude

Well-known Member
Joined
Jan 15, 2016
Messages
3,572
It isn't +1255. It is +1 comma 255. The 255 is the max number of characters to return.

That being said, I believe that you can make an easier formula such as

=RIGHT(D19,FIND("/",D19))-LEFT(D19,FIND("/",D19)-1)
 
Upvote 0

bolony21

New Member
Joined
Jul 22, 2016
Messages
40
Yes basically it is looking for the position of the "/" in d19.

Then uses the +1 to start from the next character to the right of the "/" and returns up to 255 characters.

Looks like you got sorted anyway.
 
Upvote 0

Forum statistics

Threads
1,190,627
Messages
5,982,011
Members
439,751
Latest member
megaman777

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