FRED_SHEET

New Member
Joined
Oct 13, 2017
Messages
48
#VALUE! Error

I have an Excel spreadsheet in which a random number and a blank is generated for a Numerator for a Fraction in Column F and a Denominator is generated in Column G using a formula based on the number which is generated in Column F.

When I attempt to generate the resulting value for the fraction in Column I. I am getting an error message of #VALUE!.

What is wrong with the formula I am using?

I want 0.00000 to appear in Column I if Column F is blank.

Numerator Random Number Generator – Column F
=IF(RAND()<0.3," ",RANDBETWEEN(1,63))

Denominator Function – Column G
=IF(F9>=32,64,IF(F9>=16,32,IF(F9>=8,16,IF(F9>=4,8,IF(F9>=2,4,IF(F9>=1,2,0))))))

Decimal Equivalent Fraction (Numerator divided by Denominator) Formula – Column I
=IF(F12="",0,F12/G12)

Error Message
#VALUE!

I think the problem has to do with when I an generating a blank entry Column F. :confused:
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
if you wrap the formula with
=iferror(,0.0) and custom format the cell with 0.00000 i think
 
Upvote 0
Yes, you are inserting a space " " in the cell so Excel cannot perform the math operation and it will give a "VALUE error. You could wrap the whole formula in =IFERROR(your formula here , what do you want returned if an error)
 
Upvote 0
Or don't put a space in the cell put an empty string i.e.

IF(RAND()<0.3,"",RANDBETWEEN(1,63))
instead of
=IF(RAND()<0.3," ",RANDBETWEEN(1,63))

Excel Workbook
FGHI
1240.50000
2640.00000
318320.56250
4640.00000
5640.00000
612160.75000
717320.53125
829320.90625
957640.89063
1056640.87500
1143640.67188
12640.00000
1319320.59375
14120.50000
1557640.89063
1662640.96875
1710160.62500
1829320.90625
19120.50000
Sheet1
 
Upvote 0
Or don't put a space in the cell put an empty string i.e.

instead of

Sheet1

FGHI
124 0.50000
2 64 0.00000
31832 0.56250
4 64 0.00000
5 64 0.00000
61216 0.75000
71732 0.53125
82932 0.90625
95764 0.89063
105664 0.87500
114364 0.67188
12 64 0.00000
131932 0.59375
1412 0.50000
155764 0.89063
166264 0.96875
171016 0.62500
182932 0.90625
1912 0.50000

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

Spreadsheet Formulas
CellFormula
F1=IF(RAND()<0.3,"",RANDBETWEEN(1,63))
G1=IF(F1>=32,64,IF(F1>=16,32,IF(F1>=8,16,IF(F1>=4,8,IF(F1>=2,4,IF(F1>=1,2,0))))))
I1=IF(F1="",0,F1/G1)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Thanks I am going to give this a try also, it definitely looks like it works OK. I didn't realize the impact having a space between the two quotations marks has on a formula.
 
Upvote 0
Here is another set of formulas that you could consider to produce the same results.

BTW, best not to fully quote long posts as it makes the thread harder to read/navigate. If you want to quote, quote small, relevant parts only.

Excel Workbook
FGHI
128320.875
212160.75
322320.6875
4640
529320.90625
6640
745640.703125
831320.96875
959640.921875
10640
1117320.53125
1235640.546875
Sample
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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