Home

IF function issues

%3CLINGO-SUB%20id%3D%22lingo-sub-960777%22%20slang%3D%22en-US%22%3EIF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-960777%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20looking%20for%20help%20creating%20a%20formula%20that%20will%20populate%20up%20to%20a%20certain%20amount%2C%20then%20move%20anything%20over%20that%20dollar%20amount%20to%20the%20next%20%22bucket%22%20up%20to%20a%20certain%20amount%2C%20and%20anything%20above%20that%20to%20the%20last%20%22bucket.%22%20This%20would%20be%20quarter%20over%20quarter%20data.%20I%20realized%20that%20probably%20doesn't%20make%20too%20much%20sense%2C%20but%20I'm%20stuck%20on%20this%20one%20if%20anyone%20can%20help.%20Attached%20is%20look%20at%20the%20form.%20Red%20highlighted%20cells%20are%20where%20I%20need%20my%20formulas.%20I've%20come%20close%20with%20a%20few%20formulas%20I've%20created%20but%20it's%20not%20working%20as%20a%20whole.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-960777%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-960869%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-960869%22%20slang%3D%22en-US%22%3EI'm%20looking%20at%20the%20sample%20Excel%20file%2C%20and%20am%20not%20able%20to%20figure%20out%20from%20your%20words%20above%20what%20the%20rules%20are.%20Could%20you%20spell%20them%20out%20in%20English%3F%20I%20see%20the%20nested%20IF%20statements%20in%20Cell%20H8%2C%20and%20the%20various%20antecedents%20to%20it%2C%20but%20it's%20hard%20to%20translate%20somebody%20else's%20code....%20Among%20other%20things%2C%20which%20buckets%20are%20the%20%22next%20buckets%22--you%20said%20the%20cells%20in%20red--but%20is%20each%20one%20%22next%22%20from%20the%20cell%20above%20or%20the%20cell%20to%20the%20left%3F%20And%20so%20on....%3CBR%20%2F%3E%3CBR%20%2F%3EYou're%20so%20close%20to%20it%20that%20it's%20obvious%20to%20you%2C%20but%20words%20like%20%22next%22%20can%20be%20ambiguous....%20and%20when%20you%20talk%20about%20%22eligible%22%20is%20that%20%22eligible%22%20on%20a%20YTD%20basis%20or%20just%20the%20current%20quarter...and%20so%20on.%3CBR%20%2F%3E%3CBR%20%2F%3EYour%20box%20containing%20data%20on%20incentives%20has%20a%20confusing%20label%20on%20the%20second%20line%3A%20%22Incentive%20on%20the%20second%20%24200%2C000%22%20is%20what%20you%20say%2C%20but%20the%20preceding%20line%20is%20only%20the%20%22first%20100%2C000%22%20so%20do%20you%20actually%20mean%2C%20the%20%22second%20100%2C000%22%20which%20would%20be%20%22up%20to%20200%2C000%22%3F%20I%20think%20that's%20actually%20what%20you%20mean.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20envision%20something%20like%20the%20income%20tax%20table%2C%20where%20the%20tax%20rate%20up%20to%20X%20is%20such%20and%20so%2C%20up%20to%20Y%20something%20more%2C%20and%20so%20on.%3CBR%20%2F%3E%3CBR%20%2F%3EAnyway%2C%20this%20doesn't%20look%20difficult%20once%20it's%20understood%2C%20and%20it's%20possible%20others%20are%20more%20able%20to%20grasp%20the%20intent%20already....but%20I'd%20be%20happy%20to%20give%20my%20input%20if%20you%20can%20help%20describe%20it%20more%20clearly.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-962375%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-962375%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F435137%22%20target%3D%22_blank%22%3E%40mtd2987%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHave%20look%20at%20the%20attached%20file%20(i.e.%20a%20copy%20of%20your%20own%20with%20some%20formulae%20added).%20I%20assume%20that%20this%20does%20what%20you%20asked%20for.%20I%20chose%20to%20work%20with%20MIN%20and%20MAX%20functions%20to%20determine%20the%20overflow%20of%20each%20%22bucket%22.%20I've%20tested%20it%20with%20varying%20quarterly%20fees%20earned%20and%20it%20seems%20to%20work%20all%20the%20time.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-962376%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-962376%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%20-%20Thanks%20for%20your%20response.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20start%2C%20the%20nested%20IF%20statement%20in%20cell%20H8%20is%20not%20working%20correctly%2C%20so%20I'm%20sure%20if%20I'm%20on%20the%20right%20track%20with%20that%20one%2C%20or%20if%20it%20needs%20to%20be%20removed%20and%20rewritten%20entirely.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20following%20cells%20all%20have%20formulas%20that%20are%20currently%20working%20how%20I%20need%20them%20to%3A%3C%2FP%3E%3CP%3E%26nbsp%3B-%20G7%2C%20G8%2C%20G9%2C%20H7%2C%20H9%2C%20I7%2C%20I9%2C%20J7%2C%20J9%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20cells%20I%20could%20use%20help%20with%20are%20H8%2C%20I8%20and%20J8%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20%22buckets%22%20I'm%20referring%20to%20what%20would%20%22fees%20generated%22%3C%2FP%3E%3CP%3E%26nbsp%3B%20-%20%240%20-%20%24100%2C000%20(bucket%201)%3C%2FP%3E%3CP%3E%26nbsp%3B%20-%20%24100%2C001%20-%20%24200%2C000%20(bucket%202)%3C%2FP%3E%3CP%3E%26nbsp%3B%20-%20%24200%2C001%2B%20(bucket%203)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20on%20%22sheet1%22%20of%20the%20sample%20file%20I%20attached%20would%20be%20where%20I%20record%20the%20fees%20generated%20each%20quarter%20which%20flow%20over%20to%20%22sheet2.%22%3C%2FP%3E%3CP%3EWhat%20I%20need%20to%20happen%20is%2C%20once%20fees%20generated%20are%20greater%20than%20%24100%2C000%20(bucket%201)%2C%20fees%20generated%20would%20then%20move%20to%20bucket%202%2C%20(%24100%2C001%20-%20%24200%2C000).%20Once%20fees%20generated%20are%20greater%20than%20%24200%2C000%2C%20all%20remaining%20fees%20generated%20for%20the%20year%20would%20move%20to%20bucket%203%2C%20(%24200%2C001%2B).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20for%20example%2C%20in%20the%20file%20attached%2C%20cell%20H8%20should%20be%20showing%20%2450%2C000%20--%26gt%3B%2475%2C000%20fees%20generated%20in%20Q1%20should%20all%20be%20in%20bucket%201%20as%20shown%20in%20cell%20G7.%20Another%20%2475%2C000%20was%20generated%20in%20Q2%2C%20so%20%2425%2C000%20should%20be%20in%20bucket%201%2C%20hitting%20the%20%24100%2C000%20threshold%20and%20the%20remaining%20%2450%2C000%20should%20be%20in%20bucket%202%20in%20cell%20H8.%20If%20we%20keep%20going%20with%20another%20%2475%2C000%20generated%20in%20Q3%2C%20%2450%2C000%20should%20be%20in%20bucket%202%20(cell%20I8)%20hitting%20the%20next%20%24100%2C000%20threshold%2C%20and%20the%20remaining%20%2425%2C000%20should%20then%20be%20in%20bucket%203%2C%20cell%20I9.%20Now%20that%20we're%20in%20the%20final%20bucket%2C%20all%20remaining%20fees%20in%20Q4%20would%20fall%20into%20bucket%203%2C%20cell%20J9.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20probably%20didn't%20need%20to%20include%20rows%2011-14%20in%20my%20example%20file%20as%20those%20are%20working%20correctly%20and%20are%20dependent%20on%20the%20information%20in%20rows%204-9%20being%20correct.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20let%20me%20know%20if%20you'd%20like%20any%20further%20clarification%20and%20thanks%20again%20for%20your%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-962378%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-962378%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%20-%20thank%20you%20so%20much.%20I%20didn't%20even%20think%20to%20use%20MIN%20MAX%20statements.%20Still%20learning%20some%20of%20the%20more%20%22advanced%22%20excel%20functions%20but%20this%20will%20be%20a%20great%20reference%20going%20forward.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EVery%20much%20appreciated!!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-962595%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-962595%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F435137%22%20target%3D%22_blank%22%3E%40mtd2987%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20here%20in%20the%20attached%20you'll%20see%20yet%20another%20approach.%20Like%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%20I've%20made%20use%20of%20MIN%20and%20MAX.%3C%2FP%3E%3CP%3EI've%20also%20made%20use%20of%20a%20table%20in%20such%20a%20way%20that%20you%20can%2C%20in%20the%20future%2C%20readily%20make%20changes%20to%20the%20thresholds%20and%20incentive%20percentages%20in%20this%20table.%20I've%20also%20written%20the%20formulas%20so%20they%20only%20use%20the%20row%20containing%20the%20quarters%20%22Total%20Eligible%20Fees%2C%22%20letting%20the%20formulas%20take%20care%20of%20the%20different%20step%20levels.%3C%2FP%3E%3CP%3EYou'll%20see%20I%20use%20VLOOKUP%20to%20access%20the%20Incentive%20Table%2C%20and%20I%20use%20an%20assigned%20range%20name%20%22IncentiveTbl%22%20in%20the%20VLOOKUP%20formula.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-962658%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-962658%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you!%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-962935%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-962935%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F435137%22%20target%3D%22_blank%22%3E%40mtd2987%3C%2FA%3E%26nbsp%3B%26nbsp%3B%20let%20me%20know%20if%20it%20makes%20sense%20to%20you%2C%20how%20the%20formulas%20and%20tables%20work...and%20that%20you%20see%20how%20it%20gives%20you%20flexibility.%20(I%20actually%20wondered%20why%20you%20had%20the%20different%20levels%20given%20that%20the%20incentive%20added%20was%20always%2015%25%20of%20whatever%20the%20number%20was...%3B%20but%20maybe%20you%20were%20just%20putting%20that%20out%20to%20protect%20proprietary%20info.)%26nbsp%3B%26nbsp%3B%20I%20always%20try%20to%20design%20so%20that%20tables%20are%20at%20the%20heart%20of%20as%20much%20as%20possible%2C%20to%20give%20room%20for%20future%20nuances%20without%20requiring%20the%20whole%20program%20to%20be%20rewritten.%20Back%20in%20my%20database%20days%20we%20spoke%20of%20%22table-driven%20design%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-963861%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20function%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-963861%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F435137%22%20target%3D%22_blank%22%3E%40mtd2987%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wrote%20the%20attached%20file%20specifically%20for%20a%20dynamic%20array%20version%20of%20Excel%20which%20would%20allow%20the%20arrays%20to%20resize%20without%20user%20intervention.%26nbsp%3B%20Since%20it%20is%20unlikely%20that%20many%20potential%20users%20with%20have%20dynamic%20array%20code%2C%20I%20have%20changed%20it%20to%20CSE%20arrays.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20used%20matrix%20multiplication%20to%20accumulate%20the%20cumulative%20fees.%26nbsp%3B%20After%20picking%20the%20lower%20value%20from%20every%20pair%20of%20cumulative%20fee%20and%20the%20upper%20limit%20of%20a%20fee%20band%2C%20incremental%20values%20are%20returned%20by%20differencing%20adjacent%20values%2C%20again%20using%20matrix%20multiplication%20(using%20the%20inverse%20of%20the%20matrices%20that%20accumulated%20the%20fees).%26nbsp%3B%20This%20is%20not%20for%20the%20faint-hearted!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESadly%20CSE%20is%20clunky%20and%20the%20solution%20will%20be%20a%20poor%20shadow%20of%20the%20dynamic%20array%20solution.%3C%2FP%3E%3C%2FLINGO-BODY%3E
mtd2987
New Contributor

I'm looking for help creating a formula that will populate up to a certain amount, then move anything over that dollar amount to the next "bucket" up to a certain amount, and anything above that to the last "bucket." This would be quarter over quarter data. I realized that probably doesn't make too much sense, but I'm stuck on this one if anyone can help. Attached is look at the form. Red highlighted cells are where I need my formulas. I've come close with a few formulas I've created but it's not working as a whole.

8 Replies
I'm looking at the sample Excel file, and am not able to figure out from your words above what the rules are. Could you spell them out in English? I see the nested IF statements in Cell H8, and the various antecedents to it, but it's hard to translate somebody else's code.... Among other things, which buckets are the "next buckets"--you said the cells in red--but is each one "next" from the cell above or the cell to the left? And so on....

You're so close to it that it's obvious to you, but words like "next" can be ambiguous.... and when you talk about "eligible" is that "eligible" on a YTD basis or just the current quarter...and so on.

Your box containing data on incentives has a confusing label on the second line: "Incentive on the second $200,000" is what you say, but the preceding line is only the "first 100,000" so do you actually mean, the "second 100,000" which would be "up to 200,000"? I think that's actually what you mean.

I envision something like the income tax table, where the tax rate up to X is such and so, up to Y something more, and so on.

Anyway, this doesn't look difficult once it's understood, and it's possible others are more able to grasp the intent already....but I'd be happy to give my input if you can help describe it more clearly.

@mtd2987 

 

Have look at the attached file (i.e. a copy of your own with some formulae added). I assume that this does what you asked for. I chose to work with MIN and MAX functions to determine the overflow of each "bucket". I've tested it with varying quarterly fees earned and it seems to work all the time.

@mathetes  - Thanks for your response.

 

To start, the nested IF statement in cell H8 is not working correctly, so I'm sure if I'm on the right track with that one, or if it needs to be removed and rewritten entirely.

 

The following cells all have formulas that are currently working how I need them to:

 - G7, G8, G9, H7, H9, I7, I9, J7, J9

 

The cells I could use help with are H8, I8 and J8

 

The "buckets" I'm referring to what would "fees generated"

  - $0 - $100,000 (bucket 1)

  - $100,001 - $200,000 (bucket 2)

  - $200,001+ (bucket 3)

 

So on "sheet1" of the sample file I attached would be where I record the fees generated each quarter which flow over to "sheet2."

What I need to happen is, once fees generated are greater than $100,000 (bucket 1), fees generated would then move to bucket 2, ($100,001 - $200,000). Once fees generated are greater than $200,000, all remaining fees generated for the year would move to bucket 3, ($200,001+).

 

So for example, in the file attached, cell H8 should be showing $50,000 -->$75,000 fees generated in Q1 should all be in bucket 1 as shown in cell G7. Another $75,000 was generated in Q2, so $25,000 should be in bucket 1, hitting the $100,000 threshold and the remaining $50,000 should be in bucket 2 in cell H8. If we keep going with another $75,000 generated in Q3, $50,000 should be in bucket 2 (cell I8) hitting the next $100,000 threshold, and the remaining $25,000 should then be in bucket 3, cell I9. Now that we're in the final bucket, all remaining fees in Q4 would fall into bucket 3, cell J9.

 

I probably didn't need to include rows 11-14 in my example file as those are working correctly and are dependent on the information in rows 4-9 being correct.

 

Please let me know if you'd like any further clarification and thanks again for your help.

 

 

 

@Riny_van_Eekelen  - thank you so much. I didn't even think to use MIN MAX statements. Still learning some of the more "advanced" excel functions but this will be a great reference going forward.

 

Very much appreciated!!!

@mtd2987 

 

So here in the attached you'll see yet another approach. Like @Riny_van_Eekelen  I've made use of MIN and MAX.

I've also made use of a table in such a way that you can, in the future, readily make changes to the thresholds and incentive percentages in this table. I've also written the formulas so they only use the row containing the quarters "Total Eligible Fees," letting the formulas take care of the different step levels.

You'll see I use VLOOKUP to access the Incentive Table, and I use an assigned range name "IncentiveTbl" in the VLOOKUP formula.

Thank you! @mathetes 

@mtd2987   let me know if it makes sense to you, how the formulas and tables work...and that you see how it gives you flexibility. (I actually wondered why you had the different levels given that the incentive added was always 15% of whatever the number was...; but maybe you were just putting that out to protect proprietary info.)   I always try to design so that tables are at the heart of as much as possible, to give room for future nuances without requiring the whole program to be rewritten. Back in my database days we spoke of "table-driven design"

@mtd2987 

I wrote the attached file specifically for a dynamic array version of Excel which would allow the arrays to resize without user intervention.  Since it is unlikely that many potential users with have dynamic array code, I have changed it to CSE arrays.

 

I have used matrix multiplication to accumulate the cumulative fees.  After picking the lower value from every pair of cumulative fee and the upper limit of a fee band, incremental values are returned by differencing adjacent values, again using matrix multiplication (using the inverse of the matrices that accumulated the fees).  This is not for the faint-hearted!

 

Sadly CSE is clunky and the solution will be a poor shadow of the dynamic array solution.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
50 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
32 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
15 Replies
Dev channel update to 80.0.355.1 is live
josh_bodner in Discussions on
67 Replies