Help with existing formula

spectraflame

Well-known Member
Joined
Dec 18, 2002
Messages
829
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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
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
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,214,823
Messages
6,121,777
Members
449,049
Latest member
greyangel23

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