Question

In: Computer Science

Make an Excel VBA code for this function x=(log(50)+2.2680)/(0.3046) The answer should be around 13.0233 Also...

Make an Excel VBA code for this function x=(log(50)+2.2680)/(0.3046)

The answer should be around 13.0233

Also how to declare a value example

Dim i = 0.3258

x = i * Range("A1").Value

because the answer becomes 0 or sometimes it's just value of A1

Solutions

Expert Solution

Short Summary:

  • You should proper Datatype - Double

Question 1:

Make an Excel VBA code for this function x=(log(50)+2.2680)/(0.3046)

The answer should be around 13.0233

  • Created a function that returns double value for the given formula
  • Used a sub to call the function and displayed in a message box

Source Code:

Function GetValue() As Double
Dim x As Double
x = (Log(50) + 2.268) / (0.3046)
GetValue = x
End Function

Sub Display()
MsgBox GetValue()
End Sub

Sample Run:

Question 2:

how to declare a value example

Dim i = 0.3258

x = i * Range("A1").Value

because the answer becomes 0 or sometimes it's just value of A1

Source Code:

Function GetValue() As Double
Dim i As Double
i = 0.3258
Dim x As Double
x = i * Range("A1").Value
GetValue = x
End Function

Sub Display()
MsgBox GetValue()
End Sub

Sample Run:

**************************************************************************************

Feel free to rate the answer and comment your questions, if you have any.

Please upvote the answer and appreciate our time.

Happy Studying!!!

**************************************************************************************


Related Solutions

Please show how to do in Excel Using Log-log model to estimate the demand function Model:...
Please show how to do in Excel Using Log-log model to estimate the demand function Model: log(sales) = a + b * log(price) + error Explain the results in term of how price affects sales. Market ID Sales Price Advertising 1 367 2.2 Yes 2 165 2.7 No 3 366 2.4 Yes 4 148 2.9 No 5 152 2.8 No 6 198 2.2 No 7 390 2 Yes 8 367 2.3 Yes 9 210 2.1 No 10 353 2.7 Yes...
W74) Please answer in detail with EXCEL Function since I am learning in EXCEL function Tests...
W74) Please answer in detail with EXCEL Function since I am learning in EXCEL function Tests with Chi-Square distribution    Variance               A random sample of the number of games played by individual NBA scoring leaders is shown below and reproduced in the Excel answer workbook. If a sports analyst argues that this sample variance is no different from 40 at α = .05, is she correct? Assume, of course, that the number of games played variable is normally distributed....
Matlab Code Write a procedure to calculate the log discriminant function for a given multi-variate Gaussian...
Matlab Code Write a procedure to calculate the log discriminant function for a given multi-variate Gaussian distribution and prior probability
Write a function log2(x), which gives an integer approximation of the log base 2 of a...
Write a function log2(x), which gives an integer approximation of the log base 2 of a positive number x, but it does so using recursion. Use a base case where you return 0 if x is 1 or less. In the general case, add 1 to the answer and divide x by 2. (python 3)
For a catapult project I must make a MATLAB code that should make use of the...
For a catapult project I must make a MATLAB code that should make use of the projectile motion equations so for a given input range R (horizontal distance from the catapult to the target), the code outputs the necessary velocity and firing angle of the catapult. What is the code for this? I am lost.
For a catapult project I must make a MATLAB code that should make use of the...
For a catapult project I must make a MATLAB code that should make use of the projectile motion equations so for a given input range R (horizontal distance from the catapult to the target), the code outputs the necessary velocity and firing angle of the catapult. I must be able to input ranges: 7ft, 8ft and 9ft and the output of the code should give me the possible velocities and theta of the catapult.
No other code on this website works. Define a function drawCircle. This function should expect a...
No other code on this website works. Define a function drawCircle. This function should expect a Turtle object, the coordinates of the circle’s center point, and the circle’s radius as arguments. The function should draw the specified circle. The algorithm should draw the circle’s circumference by turning 3 degrees and moving a given distance 120 times. Calculate the distance moved with the formula 2.0 × π × radius ÷ 120.0. Define a function main that will draw a circle with...
Modify the original code and add an additional function of your choice. The function should be...
Modify the original code and add an additional function of your choice. The function should be unique and something you created for this assignment. Support your experimentation with screen captures of executing the new code. Prepare a test table with at least 3 distinct test cases listing input and expected output for your unique function. #include <stdio.h> void printHelp () { printf ("\n"); printf ("a: a(x) = x*x\n"); printf ("b: b(x) = x*x*x\n"); printf ("c: c(x) = x^2 + 2*x...
This code is to be written in Matlab. Write a function that will plot cos(x) for...
This code is to be written in Matlab. Write a function that will plot cos(x) for x values ranging from -pi to pi in steps of 0.1, using black *'s. It will do this three times across in one Figure Window, with varying line widths. If no arguments are passed to the function, the line widths will be 1, 2, and 3. If on the other hand, an argument is passed to the function, it is multiplier for these values....
JAVASCRIPT HTML I'm looking to make a function that will take a postal code in a...
JAVASCRIPT HTML I'm looking to make a function that will take a postal code in a text box. The function jobs is to basically make sure the first letter of the postal code starts with these letters. ('A') ('N") ('W') ('F'). If the first letter of the postal code does not match up then an error to the user is sent.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT