# Formula based on user input

Is there a formula or vba that will take user input from a couple of cells and use a particular formula in another cell chosen based on the user input?

For example, if user enter Week # = 1, # of Days = 100, then Projected Month End needs to calculate 100/95.  But if user enters Week # = 2, # of Days = 90, then the Projected Month End needs to calculate 90/80.

Month Goal
Week #            # of Days
Projected Month End
LVL 1
CIOAsked:
###### Who is Participating?

Commented:
If you really want VBA, then I will leave to another expert who is more VBA proficient than I....

If you were to use formulas, I would suggest some sort of lookup table show the weeks out number vs. the denominator number, so you would have something like:

=current/VLOOKUP(A1,mytable,2,0)

where A1 contained the lookup value (week numbers out) and mytable is your lookup table...
0

Commented:
Are those the only options?  Can you explain the logic on how the PME is calculated?
0

CIOAuthor Commented:
It's hard to write down everything I'm trying to do with the spreadsheet all in one question.  So I was just going to post it in parts in seperate questions.

Basically, I want a dialog box type of app that a user can quickly view projected end of month sales.  The projection formula is easy.
If it is the beginning of the month (BOM) then the current days are divided by .96 to predict the end of month days.  One week out, projected = current/.93.
2W = current # of days/.92
3W = curret/.88
4W = current/.84
5W = current/.80
6W = current/.76
7W = current/.71
8W = current/.65
9W = current/.60

I know I can use nested IFs in the Projected Month End cell.  I was thinking there might be a more elegant way of programming it using VBA.  I would hate the IFs formula to get accidentally overwritten.
0

CIOAuthor Commented:
Good option.  Thank you.  I think I will use the VLOOKUP function instead.  It will be easier to modify the percentages later on if they have to be changed.
0

Commented:
You are welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

## Already a member? Login.

All Courses

From novice to tech pro — start learning today.