+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Help with an IF function

  1. #1
    Registered User
    Join Date
    07-21-2011
    Location
    Baton Rouge, Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    19

    Help with an IF function

    Hi,

    I'm trying to build a template in excel using an IF function (assuming that's what I need to use...if there's anything different, I'm open to suggestions.

    In column A, I have a dollar amount
    In column B, I have an allocation drop-down list build in with the options of Annually, Semiannually, Quarterly, Monthly, and Custom
    In columns C-N, I have Jan through Dec where I can show how much I'm spending per month

    My problem is:
    I want to be able to drop down monthly and have the dollar amount in column A divided by 12 and input in each month,
    custom: I want to be able to enter in the data as I want
    (here's where it gets hairy)...
    Semiannually, divide by 2 and end up in Jan and June only
    Quarterly, divide by 4 then input in Jan, Apr, July, Oct only

    Is that even possible using IF or do I need to consult a macro builder instead?
    Last edited by derivative_x; 08-01-2011 at 03:58 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with an IF function

    A formula can do all this. Post up your workbook with 3-4 example rows of data manually depicting the whole scenario properly, we can show you exactly from there.

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.


    Don't expect "Custom" to be a simple addition.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-21-2011
    Location
    Baton Rouge, Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Help with an IF function

    Hello,

    Sorry for the delay....

    I've attached a copy of the workbook for additional support. If needed custom can be just left out...and I can provide a note on the workbook that directs people to just enter in the data on a non-automated basis. For custom, I just want it to do nothing so I know to just put in the numbers myself

    thanks,
    Paul
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-21-2011
    Location
    Baton Rouge, Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Help with an IF function

    Here's a better picture of the information

    thanks for your help,
    Paul
    Attached Files Attached Files

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with an IF function

    This is really a series of formulas. Each on appropriate for each choice in column B. In C7, the various formulas would be:

    Monthly =$A7/12
    Quarterly =IF(ISNUMBER(SEARCH(C$6,"JANAPRJULYOCT")), $A7/4, "")
    Semiannually =IF(ISNUMBER(SEARCH(C$6,"JUNDEC")), $A7/2, "")
    Annually =IF(C$6="Jan", $A7, "")
    Custom ="-"


    Now, we can use a CHOOSE() formula put all those formulas in an array, then we can use a MATCH() function against the choice made in column B to select the correct "position" based on your named range Allocate.

    =MATCH($B7,Allocate,0)

    Putting it altogether:

    =CHOOSE(MATCH($B7,Allocate,0), IF(C$6="Jan", $A7, ""), IF(ISNUMBER(SEARCH(C$6,"JUNDEC")), $A7/2, ""), IF(ISNUMBER(SEARCH(C$6,"JANAPRJULYOCT")), $A7/4, ""), $A7/12, "-")


    Last addition, let's make sure NOTHING happens at all if either A or B is blank. Put this formula in C7 , then copy that cell down and across the entire purple section:

    =IF(OR($A7=0,$B7=""), "", CHOOSE(MATCH($B7,Allocate,0), IF(C$6="Jan", $A7, ""), IF(ISNUMBER(SEARCH(C$6,"JUNDEC")), $A7/2, ""), IF(ISNUMBER(SEARCH(C$6,"JANAPRJULYOCT")), $A7/4, ""), $A7/12, "-"))
    Last edited by JBeaucaire; 07-28-2011 at 08:36 PM.

  6. #6
    Registered User
    Join Date
    07-21-2011
    Location
    Baton Rouge, Louisiana
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: (Solved) Help with an IF function

    I cannot believe it! It works! I feel like Tom Hanks in Cast Away when he made fire! Haha

    Thank you sooooooooooooooooooooooooooo much

    -Paul
    Last edited by derivative_x; 08-01-2011 at 03:58 PM. Reason: Solved

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with an IF function

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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