+ Reply to Thread
Results 1 to 10 of 10

Running a formula based on a Drop Down option

  1. #1
    Registered User
    Join Date
    05-20-2016
    Location
    Topeka, KS
    MS-Off Ver
    Kansas
    Posts
    4

    Running a formula based on a Drop Down option

    I am trying to set up a "Refund" table for a group I work with to help them figure their own refunds.

    I have looked everywhere and not sure if Excel is able to do this or not.

    What I'm trying to do is set up a table with different options in a drop down list: "Manual Refund, Renewed in Error, . . . . When someone selects "Manual Refund" I want it to run a specific formula, and so on for the other options. I seem to only find options for VLOOKUP or INDEX,MATCH. The issue is, I can set up a formula and run it with the correct values returned to one specific row but when I copy it to the next row its still running the formula for the previous row. Is there a way to do something like this in excel or I'm I trying to ask too much from it?

  2. #2
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Running a formula based on a Drop Down option

    I'm not sure what you mean by "run a formula". It sounds like you might have some absolute cell references, but hard to tell.

    Would you be able to upload a small sample workbook with anonymised data, include your formula and what you want to happen. It just makes it easier to help you

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Running a formula based on a Drop Down option

    Hi, welcome to the forum

    Using a DD is exactly the same as using a manually entered cell, all a DD does, is assist with entries to avoid typos and save typing, or restrict entry to a specified critera.

    having said that, without seeing what data you are working on, and what you want, we cant really offer specific help
    What formulas are you using?
    What options do you want?
    As mentioned above, can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like?
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    05-20-2016
    Location
    Topeka, KS
    MS-Off Ver
    Kansas
    Posts
    4

    Re: Running a formula based on a Drop Down option

    So here is what they told me to do for VLOOKUP but I quickly learned that VLOOKUP works better for set values.

    It works for the top row but if I enter anything into the row below, it returns the totals for the row above.

    I know my formula for Manual Refund on the second sheet is only for the row I specified but when I use a "name range" in the formula it returns #VALUE!
    Attached Files Attached Files
    Last edited by ernhump11; 05-20-2016 at 12:03 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Running a formula based on a Drop Down option

    Thanks for the sample.

    When I choose a different reason on rows 6 and 7 I get the correct figures in columns N and O, with the correct total so not sure I understand the issue.

    In column P, you don't really need the =SUM(N5+05), just =N5+O5 would do

  6. #6
    Registered User
    Join Date
    05-20-2016
    Location
    Topeka, KS
    MS-Off Ver
    Kansas
    Posts
    4

    Re: Running a formula based on a Drop Down option

    It works for Row 6 but I want to enter in different dates and information into Row 7. When I do that, I still get the same totals for Row 6.

    I don't know how to explain it very well because I don't really know the right "lingo". That could be why I'm having trouble trying to find it through GOOGLE. lol

  7. #7
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Running a formula based on a Drop Down option

    No problem - it's tricky when you're first starting out

    Your LOOKUP is only checking the value you have in your Reason column which is why you get the same results every time.

    I think the problem may be more related to your table on sheet 2 as this only looks at Row 5 on Sheet 1 to calculate the 2 values you return with your LOOKUP formula so it will always produce the same results.

    Could you explain a bit more about what you are expecting to see? It looks like there are some date dependencies, but if you could write down how things should be calculated that would be great. Forget all about Excel for a minute and just note down the logic, then we can apply that (hopefully!)

  8. #8
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Running a formula based on a Drop Down option

    Hello again,

    I've spent a little time having a look at your sheet and have done a little work to embed some formulas in your "Refund" columns. To do this, I've added two helper columns at the end (you can hide these later if you want).

    The first one TYPE just puts a code number based on a new column I added to your table on Sheet 2 - it just makes it easier to see in the formula rather than having your whole reason text.

    The second one DATEDIF is basically the same formulas you had in your Sheet 2 table (I think!) - it looks like your just coming up with a months difference calculation based on sold, registration and expiration dates, but I could be wrong.

    The new refund formulas now just do something different depending on which TYPE is selected, but work on each row.

    It may not be exactly what you need, but I'm just about to go out for the evening so didn't want to leave you hanging! Have a look and see what you think on the attached file. Let me know if I'm wide of the mark though
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-20-2016
    Location
    Topeka, KS
    MS-Off Ver
    Kansas
    Posts
    4

    Re: Running a formula based on a Drop Down option

    WOW!!! Thank you all so much for your help! I think I finally got it!

  10. #10
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Running a formula based on a Drop Down option

    Excellent! Glad to have helped.

    Don't forget to tag your post as SOLVED.

    If you have any more questions, this is a great forum with lots of people very willing to help, so just fire away

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA based on only one drop down menu option in multiple columns
    By Webbers in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-26-2014, 10:51 AM
  2. Change value of cell based on a drop down menu option.
    By laxtui in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-10-2013, 07:23 AM
  3. Replies: 1
    Last Post: 12-09-2013, 04:19 PM
  4. Replies: 1
    Last Post: 10-30-2013, 07:34 AM
  5. Running a calculation based on a drop down list
    By imogul in forum Excel General
    Replies: 8
    Last Post: 03-20-2012, 12:29 PM
  6. Calculations based on Drop down list option
    By ClaireEmerald in forum Excel General
    Replies: 3
    Last Post: 08-13-2010, 04:46 AM
  7. Reading from a particular page based on drop list option
    By Taylor_1978 in forum Excel General
    Replies: 1
    Last Post: 04-22-2009, 10:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1