+ Reply to Thread
Results 1 to 4 of 4

Combind these two formulas - How?

Hybrid View

Badvgood Combind these two formulas -... 07-23-2009, 05:28 PM
pike Re: Combind these two... 07-23-2009, 05:35 PM
shg Re: Combind these two... 07-23-2009, 05:45 PM
DonkeyOte Re: Combind these two... 07-23-2009, 05:36 PM
  1. #1
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Combind these two formulas - How?

    Can these 2 following formulas be combind into one?

    In C2 there is this

    =RANK(B2,$B$2:$B$15)

    In D2 there is this

    =C2&IF(OR(MOD(C2,100)={11,12,13}),"th",CHOOSE(MIN(5,RIGHT(C2)+1),"th","st","nd","rd","th"))

    Regards BVG

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Combind these two formulas - How?

    Try...

    =RANK(B2,$B$2:$B$15)&IF(OR(MOD(RANK(B2,$B$2:$B$15),100)={11,12,13}),"th",CHOOSE(MIN(5,RIGHT(RANK(B2,$B$2:$B$15))+1),"th","st","nd","rd","th"))
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Combind these two formulas - How?

    Quote Originally Posted by pike
    =RANK(B2,$B$2:$B$15)&IF(OR(MOD(RANK(B2,$B$2:$B$15),100)={11,12,13}),"th",CHOOSE(MIN(5,RIGHT(RANK(B2, $B$2:$B$15))+1),"th","st","nd","rd","th"))
    Which is a good reason not to do it -- it takes two understandable formulas and makes one piece of mush that takes three times as long to evaluate.

    On the edge of inscrutable, here's an alternative for D2 (not mine, but don't know who should be credited):

    =C26 & MID("thstndrdth", MIN(9, 2 * RIGHT(C26) * (MOD(C26-11, 100) > 2) + 1), 2)
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Combind these two formulas - How?

    You can, replace each reference to C2 in D2 with the RANK function... the advantage of using separate cells is that you avoid needlessly repeating functions (RANK)
    (ie more efficient to use two cells as opposed to one in this instance)

+ 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