Extracting Numerator and Denominator to Difference Cells

Taylorxu

New Member
Joined
Oct 17, 2017
Messages
6
Hello,

I am attempting to extract both the numerator and denominator of a fraction into separate individual cells.
For example, a fraction of 209/69, I am seeking your assistance in a formula that can have the 209 and 69 in two separate cells. The fraction varies from one digit in the numerator to three digits in the numerator.

I have been using =LEFT(TEXT(MOD(A1,1),"#/##"),FIND("/",TEXT(MOD(a,1),"#/##"))-1) for the numerator and it is not working constantly with differentiating numerators.

Any assistance would be appreciated.

Thank you
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,666
If you want numbers instead of text, add +0 after the last ")" in both formulas.

Sheet1 (2)



ABC
1209/6920969

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B1=TRIM(LEFT(SUBSTITUTE($A1,"/",REPT(" ",100)),100))
C1=TRIM(RIGHT(SUBSTITUTE($A1,"/",REPT(" ",100)),100))

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:

Taylorxu

New Member
Joined
Oct 17, 2017
Messages
6
Thank you for your reply, when I enter =TRIM(LEFT(SUBSTITUTE($A1,"/",REPT(" ",100)),100))+0 I just receive the fraction as a whole, identical to that in A1
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,666
Thank you for your reply, when I enter =TRIM(LEFT(SUBSTITUTE($A1,"/",REPT(" ",100)),100))+0 I just receive the fraction as a whole, identical to that in A1
Format the cell as a number with 0 decimal places.
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
16,317
Welcome to Mr Excel forum

Maybe...
Numerator
=LEFT(TEXT(A1,"###/###"),SEARCH("/",TEXT(A1,"###/###"))-1)

Denominator
=MID(TEXT(A1,"###/###"),SEARCH("/",TEXT(A1,"###/###"))+1,3)

Hope this helps

M.
 

Taylorxu

New Member
Joined
Oct 17, 2017
Messages
6
When I format it with as a number with zero decimal places the result is 3 in both formulas.
 

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,666
When I format it with as a number with zero decimal places the result is 3 in both formulas.
Very strange. Can you try entering 209/69 in A1 on a fresh sheet and the two formulas using the +0 in B1 and C1 respectively?
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
22,801
If A1 is a number, formatted to show as a fraction, something like

=TRIM(LEFT(SUBSTITUTE(TEXT($A1, "?/???"),"/",REPT(" ",100)),100))
 

Taylorxu

New Member
Joined
Oct 17, 2017
Messages
6
Thank you for your help.

The 209/69 fraction is a product of another calculation. When I use =TRIM(LEFT(SUBSTITUTE($A1,"/",REPT(" ",100)),100))+0 for 209/69 when the cell is a resulting formula and there are no decimal places your formula products 3.

When I enter in 209/69 manually and use =TRIM(LEFT(SUBSTITUTE($A1,"/",REPT(" ",100)),100)) I receive 209. How could this be?
 

Forum statistics

Threads
1,082,276
Messages
5,364,196
Members
400,786
Latest member
ismi88

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top