Fractions in Text

DBCox

Board Regular
Joined
Jul 5, 2012
Messages
52
Hello everyone,

I hope the title is not too confusing, but I couldn't think of what else to put. I am trying to string together several cells to create a machine nut description. I have a spreadsheet with several columns (thread diameter, pitch, locking/non-locking, etc). I need a cell with a "call out" for that nut. So, column A contains the diameter, B contains the pitch, and C contains the locking/non-locking parameter, I would use the following equation:


=A2&" -"&B2&" "&C2&" Nut"


That works, except I need the diameter column to be represented with a fraction. I can easily make Excel display the fractional equivalent in the column, but when I string them together, it defaults back to a decimal.

I know there has to be an easy solution to this, but I am not knowledgeable enough to find it.

Thanks!
 
If your decimal values do not equate to exact 16th, you may get odd denominators if you use the suggestion in Message #7.

In that case, if you want to first round it to the nearest multiple of 1/16, use

=TEXT(MROUND(A2,1/16),"? ?/??")
 
Upvote 0

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
In that case, if you want to first round it to the nearest multiple of 1/16, use

=TEXT(MROUND(A2,1/16),"? ?/??")
Ah yes, good point. Thanks!

As for the UDF that I posted... it was old compiled VB code I had developed maybe 10 years ago or so that I resurrected for my answer here.
 
Upvote 0
Well if it was already VB code, it's not that old. :)

As I said in my earlier follow-up message, the original code was developed in the compiled version of VB, not VBA. It appears I first posted it online sometime in June of 2000 (so the code is over 13 years old). This website (Message #2)...

Decimals to Fractions, Help.

which contains many archived newsgroup message threads shows I started posting it online at least as of June 1, 2000. I started my online volunteering efforts in 1999, so if I had posted it earlier, it could not have been too much earlier than that.
 
Upvote 0
Yes, I meant that if it was already Visual Basic, it means that windows already existed, and that's why I was joking that the code was not that old, or else it would be Basic (without the Visual). I still have some code somewhere from long ago, if I'm not mistaken some even from before God created Earth. :)
 
Upvote 0
Yes, I meant that if it was already Visual Basic, it means that windows already existed, and that's why I was joking that the code was not that old, or else it would be Basic (without the Visual). I still have some code somewhere from long ago, if I'm not mistaken some even from before God created Earth. :)
Okay, I see what you meant; however, 13+ years (how old I determined the code was in Message #15) is kind of old, isn't it? Although, I did start my BASIC language coding in 1981 (32 years ago), so, by that measure, I guess you might be right.
 
Upvote 0
Okay, I see what you meant; however, 13+ years (how old I determined the code was in Message #15) is kind of old, isn't it? Although, I did start my BASIC language coding in 1981 (32 years ago), so, by that measure, I guess you might be right.

Wow, that's interesting. I had my first contact with programming in 76-77 with Fortran and PL/1 (that the professor at the university said it would be the future language for programming in the world ), and then C in a unix system but it was only in after 1980 that I had contact with Basic and I guess it was also 1981.

I guess that means that makes us Basic Pals. :)
 
Upvote 0
Wow, that's interesting. I had my first contact with programming in 76-77 with Fortran and PL/1 (that the professor at the university said it would be the future language for programming in the world ), and then C in a unix system but it was only in after 1980 that I had contact with Basic and I guess it was also 1981.

I guess that means that makes us Basic Pals. :)
Yes, we are Basic Pals for sure. You probably started with a different BASIC than I did though... mine was TI-BASIC, a variant of BASIC that Microsoft developed for Texas Instruments TI-99/4 computer to cater to some specialized functions that were built into the operating system (mainly Sprites... **** but I miss them), actually, I think they may have been built into the processor chip itself. After TI-BASIC, I moved on to Atari ST-BASIC (also a Microsoft coded variant) and then onto the variant of Microsoft BASIC that was built into the Radio Shack Model 100 (first actual laptop computer) before finally moving on to a PC and GWBASIC where I stayed until VBDOS came out... eventually I move to the compiled version of VB at Version 3. I did some FORTRAN (IV if I remember correctly) programming for a couple of years as well as UNIX shell scripting (the two of them were concurrent), Delpi (a PASCAL variant) and a small amount of C (the predessor to C++) along the way as well.
 
Upvote 0

Forum statistics

Threads
1,216,784
Messages
6,132,696
Members
449,753
Latest member
swastikExcel

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