Home

IFS function + roundup, sum, and right

%3CLINGO-SUB%20id%3D%22lingo-sub-377146%22%20slang%3D%22en-US%22%3EIFS%20function%20%2B%20roundup%2C%20sum%2C%20and%20right%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-377146%22%20slang%3D%22en-US%22%3E%3CP%3EI%20can't%20get%20less%20than%20and%20more%20than%20to%20work%20how%20I'd%20like%20it%20to%20in%20an%20IFS%20function.%3CBR%20%2F%3E%3CBR%20%2F%3E%3DIFS((RIGHT(ROUNDUP(SUM(((G6*0.55)%2BG6)%2B((G6*0.55)%2BG6)%2F11)%2C2)%2C4))%26lt%3B%3D5%2CCEILING(SUM(((G6*0.55)%2BG6)%2B((G6*0.55)%2BG6)%2F11)%2C5)%2CRIGHT(ROUNDUP(SUM(((G6*0.55)%2BG6)%2B((G6*0.55)%2BG6)%2F11)%2C2)%2C4)%26gt%3B5%2CCEILING(SUM(((G6*0.55)%2BG6)%2B((G6*0.55)%2BG6)%2F11)%2C10)-1)%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EWhat%20I'm%20trying%20to%20achieve%3A%20numbers%20below%205%20round%20to%20a%205%2C%20numbers%20above%205%20round%20to%20a%209.%3C%2FP%3E%3CP%3ERIGHT(ROUNDUP(SUM))%20%3D%20%244.46%20in%20the%20first%20cell%20I'm%20working%20on%2C%20but%20%26lt%3B%3D5%20at%20the%20end%20of%20the%20first%20logical%20test%20comes%20up%20false.%20It%20seems%20to%20be%20happening%20with%20all%20numbers%20below%205%2C%20so%20everything%20is%20being%20rounded%20up%20to%209.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-377146%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-382708%22%20slang%3D%22en-US%22%3ERe%3A%20IFS%20function%20%2B%20roundup%2C%20sum%2C%20and%20right%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-382708%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F303932%22%20target%3D%22_blank%22%3E%40misabella%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E..%20or%20if%20you%20want%20to%20name%20the%20coins%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%20CEILING(amount%2C%20nickel)%20-%20(MOD(amount%2C%20dime)%26gt%3Bnickel)*penny%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EInterestingly%20an%20exact%20number%20of%20dollars%20will%20go%20down%201%20cent%20to%20the%2099%20cents%20below.%26nbsp%3B%20This%20is%20due%20to%20rounding%20error%20caused%20by%20the%20fact%20that%20decimal%20coinage%20does%20not%20have%20an%20exact%20representation%20in%20binary%20arithmetic.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-382079%22%20slang%3D%22en-US%22%3ERe%3A%20IFS%20function%20%2B%20roundup%2C%20sum%2C%20and%20right%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-382079%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F303932%22%20target%3D%22_blank%22%3E%40misabella%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%20CEILING(amount%2C%200.05)%20-%20(MOD(amount%2C%200.1)%26gt%3B0.05)%20*%200.01%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-381413%22%20slang%3D%22en-US%22%3ERe%3A%20IFS%20function%20%2B%20roundup%2C%20sum%2C%20and%20right%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-381413%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F303932%22%20target%3D%22_blank%22%3E%40misabella%3C%2FA%3E%26nbsp%3B%2C%20if%20you'd%20like%20to%20have%20only%205%20or%209%20you%20may%20use%3C%2FP%3E%0A%3CPRE%3E%3D(G6%26gt%3B5)*4%2B5%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-377306%22%20slang%3D%22en-US%22%3ERe%3A%20IFS%20function%20%2B%20roundup%2C%20sum%2C%20and%20right%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-377306%22%20slang%3D%22en-US%22%3E%3CP%3Enevermind%2C%20put%20SUM%20in%20front%20of%20each%20RIGHT%20function%2C%20and%20now%20it%20works%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
misabella
New Contributor

I can't get less than and more than to work how I'd like it to in an IFS function.

=IFS((RIGHT(ROUNDUP(SUM(((G6*0.55)+G6)+((G6*0.55)+G6)/11),2),4))<=5,CEILING(SUM(((G6*0.55)+G6)+((G6*0.55)+G6)/11),5),RIGHT(ROUNDUP(SUM(((G6*0.55)+G6)+((G6*0.55)+G6)/11),2),4)>5,CEILING(SUM(((G6*0.55)+G6)+((G6*0.55)+G6)/11),10)-1)

What I'm trying to achieve: numbers below 5 round to a 5, numbers above 5 round to a 9.

RIGHT(ROUNDUP(SUM)) = $4.46 in the first cell I'm working on, but <=5 at the end of the first logical test comes up false. It seems to be happening with all numbers below 5, so everything is being rounded up to 9.

4 Replies

nevermind, put SUM in front of each RIGHT function, and now it works :) 

@misabella , if you'd like to have only 5 or 9 you may use

=(G6>5)*4+5

@misabella 

= CEILING(amount, 0.05) - (MOD(amount, 0.1)>0.05) * 0.01

 

@misabella 

.. or if you want to name the coins

= CEILING(amount, nickel) - (MOD(amount, dime)>nickel)*penny

Interestingly an exact number of dollars will go down 1 cent to the 99 cents below.  This is due to rounding error caused by the fact that decimal coinage does not have an exact representation in binary arithmetic.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 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
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies