Formula to output 0' -0".

OfficeUser

Well-known Member
Joined
Feb 4, 2010
Messages
544
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
This my current formula:
=IF(ISNUMBER(FIND("'",$R8)),LEFT($R8,FIND("'",$R8)-1))+(SUBSTITUTE(IF(ISERROR(SEARCH(" ",$R8)),"0 ","")&MID($R8,IF(ISNUMBER(FIND("-",$R8)),FIND("-",$R8)+1,1),8),"""","")&IF(ISERROR(SEARCH("/",$R8)),"/1",""))/12

It works very well. The problem is when R8 is a value of 0'- 0"

Then I get a #VALUE! in cell Q8 where this formula resides. I having been trying multiple things to simply have it show 0'- 0" but all have failed. Anyone have any suggestions? Thanks.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
This my current formula:
=IF(ISNUMBER(FIND("'",$R8)),LEFT($R8,FIND("'",$R8)-1))+(SUBSTITUTE(IF(ISERROR(SEARCH(" ",$R8)),"0 ","")&MID($R8,IF(ISNUMBER(FIND("-",$R8)),FIND("-",$R8)+1,1),8),"""","")&IF(ISERROR(SEARCH("/",$R8)),"/1",""))/12

It works very well. The problem is when R8 is a value of 0'- 0"

Then I get a #VALUE! in cell Q8 where this formula resides. I having been trying multiple things to simply have it show 0'- 0" but all have failed. Anyone have any suggestions? Thanks.
Try one of these...

If you're using Excel 2007 or later...

=IFERROR(IF(ISNUMBER(FIND("'",$R8)),LEFT($R8,FIND("'",$R8)-1))+(SUBSTITUTE(IF(ISERROR(SEARCH(" ",$R8)),"0 ","")&MID($R8,IF(ISNUMBER(FIND("-",$R8)),FIND("-",$R8)+1,1),8),"""","")&IF(ISERROR(SEARCH("/",$R8)),"/1",""))/12,"0'-0""")

This one will work in any version of Excel...

=LOOKUP("zzz",CHOOSE({1,2},"0'-0""",IF(ISNUMBER(FIND("'",$R8)),LEFT($R8,FIND("'",$R8)-1))+(SUBSTITUTE(IF(ISERROR(SEARCH(" ",$R8)),"0 ","")&MID($R8,IF(ISNUMBER(FIND("-",$R8)),FIND("-",$R8)+1,1),8),"""","")&IF(ISERROR(SEARCH("/",$R8)),"/1",""))/12))
 
Upvote 0
Here's a much simpler formula:

=LEFT(R8,FIND("'",R8)-1)+(SUBSTITUTE(REPLACE(R8,1,FIND("-",R8)-1,""),"""","")/-12)

However I did not get an error with your formula assuming an entry of 0'-0"

Excel Workbook
OPQR
800'-0"
90
Sheet1
 
Upvote 0
=LOOKUP("zzz",CHOOSE({1,2},"0'-0""",IF(ISNUMBER(FIND("'",$R8)),LEFT($R8,FIND("'",$R8)-1))+(SUBSTITUTE(IF(ISERROR(SEARCH(" ",$R8)),"0 ","")&MID($R8,IF(ISNUMBER(FIND("-",$R8)),FIND("-",$R8)+1,1),8),"""","")&IF(ISERROR(SEARCH("/",$R8)),"/1",""))/12))

This formula will output "0'- 0" regardless of what is in cell R8. Thanks.
 
Last edited:
Upvote 0
Here's a much simpler formula:
=LEFT(R8,FIND("'",R8)-1)+(SUBSTITUTE(REPLACE(R8,1,FIND("-",R8)-1,""),"""","")/-12)

This does work but does have its limitations. The formula I intially posted was due to possible variations. Sometimes a user inputs it as 13' 2-3/4" or 13' 2 3/4" or like it should be, 13'- 2 3/4". It was intended to work with all variations that I noticed. Thanks.
 
Upvote 0
Does this formula work the way you want?

=LEFT(A1,FIND("'",A1)-1)+SUBSTITUTE(SUBSTITUTE(MID(TRIM(A1),FIND("'",A1)+1,99),"-"," "),"""","")/12
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

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