+ Reply to Thread
Results 1 to 9 of 9

Excel arrays going down rows then across columns

  1. #1
    Registered User
    Join Date
    09-29-2014
    Location
    Australia, Queensland
    MS-Off Ver
    10
    Posts
    6

    Excel arrays going down rows then across columns

    Situation:
    I am trying to create an array which is reasonable complex as follows:
    I have a calendar which is setup with the staff listed across the columns
    For each of the staff there are several rows below to enter their competencies which from a list of more than a dozen and each staff can have different competencies
    Under the above is the calendar where each day is a row
    For each day we enter if the staff are working days, night, extra days, extra nights or it is blank when they are not in.

    What I want:
    What I want to do is calculate for each day is calculate for each competency the number of staff who are in on days (including extra days) and do the same for nights (including extra nights) so that we can identify deficiencies in competencies i.e. manning.

    Issues:
    I tried this using excel arrays, but excel works through rows then columns and doesn’t provide the result I desire. I want it to work down rows then along the columns.
    Is there a way of doing this with arrays?

    Temporary solution:
    I have created a formula to get about this; however, it is a very large formula calculates through the rows for each column and has the major set back that it doesn’t allow staff to be added or moved. It also increases the file size by a lot which is causing an issue on SharePoint.
    The problem with the temporary solution is that the numbers of staff are increasing and each formula competency required 4000 characters. I have competencies 18 on each row * 365 days, this is then repeated for three years and will only increase. This is excluding the overtime (extra days or extra nights) which will double the formulas again!!!
    Getting an array to work would be a major reduction in this and make my life so much easier!!!
    If you know of a solution let me know. I am trying to refrain from VBA at the moment, if there is no other solution then this will have to be the go but I’m concerned about the processing demand to go calculate the code for the 18 cells *365 for each change.

    Jon
    Last edited by JonT-W; 09-29-2014 at 08:41 PM. Reason: Spelling mistake

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Excel arrays going down rows then across columns

    If you post a workbook with sample data and the results you expect it will be much easier to help you.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    09-29-2014
    Location
    Australia, Queensland
    MS-Off Ver
    10
    Posts
    6

    Re: Excel arrays going down rows then across columns

    Hi Jacc,

    I have attached a copy.

    So what I want to do is create an array formulaa in cells:
    C20:DM284
    DQ20:DS384

    EH20:EM385
    EQ20:ES284

    If you click on these formulas you get the results I expect. The problem is that I now want to now add extra days (E) and nights (X) but if I duplicate these forumlas they stop calculating (exceed excels cell limit). I also want to make it easier to add personnel which is not easy at the moment.
    I began some crude vba code which could be tweaked but expect this to take much longer to compute.

    Roster Management.xlsm

    Any help would be appreciated

    Jon
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-29-2014
    Location
    Australia, Queensland
    MS-Off Ver
    10
    Posts
    6

    Re: Excel arrays going down rows then across columns

    The sort of array I would like to use is:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Where
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    However, this counts the number of "I"s then multiplies it by the number of "D"s resulting in 168 rather than 2. The arrays run across the rows rather than down columns!! I'd like to transpose the way the array calculates it!

  5. #5
    Registered User
    Join Date
    09-29-2014
    Location
    Australia, Queensland
    MS-Off Ver
    10
    Posts
    6

    Re: Excel arrays going down rows then across columns

    The sort of array I would like to use is:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Where
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    However, this counts the number of "I"s then multiplies it by the number of "D"s resulting in 168 rather than 2. The arrays run across the rows rather than down columns!! I'd like to transpose the way the array calculates it!

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: Excel arrays going down rows then across columns

    {=SUM(($E$12:$CQ$18="I")*($E$20:$CQ$20="D"))}
    Try this array formula (Ctrl + Shift + Enter)
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Excel arrays going down rows then across columns

    Good one nflsales!
    I took the liberty to play around with some more formulas in your sheet. You definitely need to get acquainted with array formulas.
    There is more potential for improvements in that sheet.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-29-2014
    Location
    Australia, Queensland
    MS-Off Ver
    10
    Posts
    6

    Re: Excel arrays going down rows then across columns

    Thanks for that, it worked and was really appreciated, I spent many hours trying all the permutations I could think of.

    So I have now updated the spreadsheet as attached. What I wanted to do is to be able to include the extra days "E"s as well as "D"s. I managed to get the following to work:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I tried to use OR statements such as:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But it didn't seem to work it just counted the "I"s

    I updated all the other formulas to use arrays

    Roster Management.xlsm

    I am a little confused as to why the workbook file size increased from removing all those long equations!

    If you can see improvement to the arrays used let me know as I am keep to learn.

  9. #9
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,841

    Re: Excel arrays going down rows then across columns

    OR and AND does not work in array formulas, it will just make a single OR or AND of the whole array (like SUM). Instead of OR you can use +. Instead of AND you can use * (which is what nflsales did).

    In DH20 try this array formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. download excell file using excell 2010 not excell 97-2003
    By devexcell in forum Excel General
    Replies: 2
    Last Post: 06-02-2014, 07:03 AM
  2. Sum columns within arrays and then multiplying arrays [?]
    By slickpusher in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-08-2012, 08:50 PM
  3. [SOLVED] Excel 2007 : Can Excell create adjustable table (number of columns and rows) ?
    By western_gunner in forum Excel General
    Replies: 5
    Last Post: 06-19-2012, 04:05 AM
  4. Arrays - Rows and Columns
    By kraljb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2006, 06:55 AM
  5. excell arrays
    By Tommy Tank in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-28-2006, 05:20 PM

Tags for this Thread

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