RANDBETWEEN WITH IF CONDITIONS

NAGARAJAN_EXCEL

New Member
Joined
Sep 29, 2020
Messages
5
Office Version
  1. 2019
Platform
  1. Windows
1601379518147.png

A=RANDBETWEEN (117,151)
B=RANDBETWEEN (10.8,13.4)
C=RANDBETWEEN(D-20,D+20)
D=RANDBETWEEN(68,92)
E=C/D
F=((0.48*B*((A)/E)/1000))
G=(6700-(5*25))*F*((1/(500-25))-(1/(800-25)))*0.9

THIS FORUMULA, I have given in cells
BUT I REQUIRE
F <1.250
G>2.220
H= IF(AND(F <1.250,G>2.220),"OK","WRONG")

IS IT POSSIBLE, PLEASE GUIDE ME HOW TO DO
 
MrExcel_RANDBETWEEN WITH IF CONDITIONS.xlsx
ABCDEFGH
1ABCDEFGComment
214011,676880,8636363640,9026021054,3527182
3F has to be at least:0,4603506552,22
4Minimum F will be achieved by applying:
511710,888681,2941176470,468680727Ok
6
7Maximum F is achieved by applying:
815113,448680,7058823531,375912Wrong
9
10F is safely below 1.25 by applying:
1115113,452,8350208680,77698561,2499999999999800Ok
12
13So the general formula could be:
1412011,898901,0888888890,6241959183,0101292Ok
Sheet1
Cell Formulas
RangeFormula
A2,A14A2=RANDBETWEEN(117,151)
B2,B14B2=RANDBETWEEN(108,134)/10
C2C2=RANDBETWEEN(D2-20,D2+20)
D2,D14D2=RANDBETWEEN(68,92)
E2,E14,E11,E8,E5E2=C2/D2
F2,F14,F11,F8,F5F2=0.48*B2*A2/E2/1000
G14,G2:G3G2=(6700-(5*25))*F2*((1/(500-25))-(1/(800-25)))*0.9
C5C5=D5+20
C8C8=D8-20
H8,H11H8=IF(F8<1.25,"Ok","Wrong")
C11C11=D11-MIN(20,D11-A11*B11*D11*0.48/1250-0.000000000001)
C14C14=RANDBETWEEN(D14-MIN(20,D14-A14*B14*D14*0.48/1250-0.000000000001),D14+20)
H14H14=IF(AND(F14<1.25,G14>2.22),"Ok","Wrong")
 
Last edited:
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
As Joeu2004 mentioned, the ROUNDUP is necessary (here in C14):
VBA Code:
=RANDBETWEEN(D14-ROUNDDOWN(MIN(20,D14-A14*B14*D14*0.48/1250-0.000000000001),0),D14+20)
which is
VBA Code:
=RANDBETWEEN(MAX(D14-20,ROUNDUP(A14*B14*D14*0.48/1250+0.000000000001),0),D14+20)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,388
Messages
6,124,648
Members
449,177
Latest member
Sousanna Aristiadou

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