+ Reply to Thread
Results 1 to 17 of 17

Arranging values from Series of Arrays in Descending Order by Formula - Not Macro

Hybrid View

  1. #1
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,769

    Re: Arranging values from Series of Arrays in Descending Order by Formula - Not Macro

    Revised "Satisfactory" formula I16:L16

    =IFERROR(INDEX($C$3:$K$3,,(INT((ROWS($1:1)-1)/COUNTA($B$5:$B$10)))*2+1),"")

    =IFERROR(IF(N16<>"",INDEX($D$5:$L$10,MOD((ROWS($1:1)-1),COUNTA($B$5:$B$10))+1,((INT((ROWS($1:1)-1)/COUNTA($B$5:$B$10))*2+1))),""),"")

    =IFERROR(IF(O16<>"",INDEX($C$5:$K$10,MOD((ROWS($1:1)-1),COUNTA($B$5:$B$10))+1,((INT((ROWS($1:1)-1)/COUNTA($B$5:$B$10))*2+1))),""),"")

    =IFERROR(INDEX($C$4:$K$4,,(INT((ROWS($1:1)-1)/COUNTA($B$5:$B$10)))*2+1),"")

  2. #2
    Banned User!
    Join Date
    09-26-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    218

    Re: Arranging values from Series of Arrays in Descending Order by Formula - Not Macro

    Hi John/Jason,

    Thanks again for spending time on this for me and for the revised formulas. I hate to be the bearer of bad news because what you both have produced has exceeded my abilities, but I've found the following problems:

    John
    With respect to the latest formulas you provided, the second and third ones are generating blank results. The first and fourth are working as expected. Please see the attached.

    Can I also ask what this part of the formula is for - (INT((ROWS($1:1)-1)

    Jason
    I have adapted your formulas to my real spreadsheet. Just to remind you of one of the comments I made earlier, I said
    "Please note that the number of departments can increase or decrease month to month so the solution must have the flexibility to list "Expense Type 1 - Dept. 4" should Dept 4 ever be added."

    Using your first formula as an example, this is not possible. The reason why is in red below:
    =IF(B15="","",IFERROR(INDEX($C$3:$K$3,IFERROR(MATCH(B15,$C$3:$K$3,0),1)+((COUNTIF(INDEX($C$5:$K$7,0,IFERROR(MATCH(B15,$C$3:$K$3,0),1)),"<>0")=COUNTIF(B$15:B15,INDEX($C$3:$K$3,IFERROR(MATCH(B15,$C$3:$K$3,0),1))))*2)),""))

    The problem being that the array in red assumes only 3 rows, where in fact there may be four or five in coming months. Therefore I amended the formula as follows (again see red):

    =IF(B15="","",IFERROR(INDEX($C$3:$K$3,IFERROR(MATCH(B15,$C$3:$K$3,0),1)+((COUNTIF(INDEX($C$5:$K$10,0,IFERROR(MATCH(B15,$C$3:$K$3,0),1)),"<>0")=COUNTIF(B$15:B15,INDEX($C$3:$K$3,IFERROR(MATCH(B15,$C$3:$K$3,0),1))))*2)),""))
    but the problem with this is that the journal list is now generating 'x' number of lines for each expense type where 'x' is equal to the number of rows in the array (red above) less those rows in the array which contain a zero value for that expense type.

    And as much as your last comment made me laugh (I got some strange looks having just burst out laughing for no apparent reason) I wouldn't want to put you through that again, so if it's easier to generate a formula for the 'Satisfactory Solution' this would be great. John's seems to be almost there, so if either of you can look into the problem I outlined above, that would be fantastic.
    Attached Files Attached Files
    Last edited by STUARTXL; 06-18-2016 at 02:07 PM.

+ 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] Cancatenate values on one cell on descending order
    By score in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 09-28-2015, 09:35 PM
  2. [SOLVED] Formula to Rank Values in Descending Order
    By brent_excel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-16-2015, 07:44 PM
  3. Replies: 3
    Last Post: 01-05-2013, 11:06 AM
  4. [SOLVED] Rank values in descending order with duplicates
    By mcain1981 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-14-2012, 01:15 PM
  5. Sorting in descending order and show duplicate values
    By cceze in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-19-2012, 09:33 AM
  6. Replies: 14
    Last Post: 04-17-2012, 05:18 PM
  7. Macro for arranging in descending order.
    By Taureankv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2010, 10:24 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