Spreadsheet Simulation in ExcelPart 1Spreadsheet SimulationKey concepts:• Using Excel Spreadsheet Function• Generate random numbers within a spreadsheetenvironment• Generate random variables with variousdistributional models within a spreadsheetUsing IF( )• The IF Function allows decision makers to considermore than one alternative. The IF function has threeparts/arguments:1. Logical test —what are we asking? Or what is thequestion?2. Value if true —what do we want displayed if theanswer to our question is “true”?3. Value if false —what do we want displayed if theanswer is “false”?• The syntax or the structure of the IF Function is:=IF(logical test, value if true, value if false)IF()IF and Nested IF• How to use the IF function to calculate regular timeand overtime in a weekly payroll.• The overtime rate is different than the regularworking hours’ rate.• Employees’ salaries are calculated the following way:• IF an employee worked up to 40 hours a week, thesalary = Rate × Hours worked,• otherwise his salary for the first 40 hours to be Rate× 40, plus one and half times the rate (Rate × 1.5) forthe hours worked over 40 (Hours worked > 40).=IF(D3<=40, C3*D3, 40*C3+(D3–40)*1.5*C3)Example using IF() Function=IF(C2>=90, “A”, If (C2>=80, “B”, IF(C2>=70, “C”,C2>=60, “D”, “F”)Example using nested IF() FunctionGrade DataA >= 90B >= 80C >= 70D >= 60F < 60Vlookup()Approximate and Exact Match• Lookup tables are a good way to search for informationand to return specific data relating to the informationyou introduce or look for.• The Lookup function is a quick way to find theinformation one needs, and is particularly efficient whendealing with large databases that would be extremelytime-consuming to search manually.• This lesson will introduce a vertical lookup table in twoways or configurations.• The first one is when you are looking to return a singlevalue within a certain data range.• The second way will demonstrate a request for an exactmatch.Example Lookup Tables=VLOOKUP(Lookup value, Table array,Col index number, Range lookup)• The lookup value is in cell C2.• The table array is our lookup table. Here is $F$2:$G$6.• Col index number is which column in the table, 2.• Range lookup: TRUE for approximate match,FALSE for exact match=VLOOKUP(C2,$F$2:$G$6,2,FALSE)Example Lookup TablesRAND() and RANDBETWEEN()RandomnessRandomness in Excel• The RAND() function in Excel will generate a randomnumber uniformly distributed on the interval from(0,1).• Excel also has the worksheet functionRANDBETWEEN(a,b) which will generate a randominteger between [a,b].• If you do turn off automatic calculation, you can useF9 to cause the spreadsheet to recalculate.Simulation Examples in a SpreadsheetCoin Tossing• Simulate a sequence of 10 coin tosses.=RAND()=IF(RAND()<0.5, “Head”, ”Tail”)Simulation Examples in a SpreadsheetRandom Service Times• An automated telephone information service spendseither 3, 6, or 10 minutes with each caller.• The proportion of calls for each service length is 30%,45%, and 25%, respectively.• Simulate these service times in spreadsheet.Using VLOOKUP( )• The VLOOKUP cell function provides an easy way toimplement the inverse transform method for discretedistributions.• An example and implement it with the VLOOKUP().• Let X be a discrete random variable, with X ∈ {1, 2, 3, 4}.
การแปล กรุณารอสักครู่..
