+ Reply to Thread
Results 1 to 6 of 6

Autofil pairs of rows

  1. #1
    Registered User
    Join Date
    04-14-2020
    Location
    Mauritius
    MS-Off Ver
    2016
    Posts
    4

    Autofil pairs of rows

    Dear Excelforum community,

    I am far from expert so this might be as simple as a function I don't know about.

    I think the attached is self-explanatory, but in case you need a real-life example :
    A, B and C would be 3 persons
    a and b would be 2 restaurants
    lines would be dates or 1 2 3...

    A, B and C are most of the time in the same city, but sometimes they travel. When they are out of town, this is recorded with a 3.
    I record every time A, B or C are going to either a or b restaurant. This is recorded with a 1.
    Then I want to calculate a matrix of how many times A+B were in the same restaurant in the same day, then A+C, then B+C, etc... for 30+ people.
    I already have that matrix.

    now I want to know how many times they have been in town together. Meaning counting all the lines with no 3 in either pair, for all the pairs.

    Final things will be easy, but will be to calculate a %age of times each pair have been to the restaurant the same day KNOWING they were both in town.
    If A and B have been to the restaurant together 5 times over a period of 15 days, but B was out of town for 5 days during that period, then my final matrix will show AB : 5/10.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-22-2020
    Location
    Malaysia
    MS-Off Ver
    2013 and 365 Pro Plus
    Posts
    56

    Re: Autofil pairs of rows

    I try

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


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


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


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


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


    L12
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by biex; 04-14-2020 at 07:20 AM.

  3. #3
    Registered User
    Join Date
    04-14-2020
    Location
    Mauritius
    MS-Off Ver
    2016
    Posts
    4

    Re: Autofil pairs of rows

    Thanks biex ! It does work for that example, but I can't find out how to autofill those formulas for them to work over the 961 cases I need in the real-life dataset. Any ideas ?

  4. #4
    Registered User
    Join Date
    03-22-2020
    Location
    Malaysia
    MS-Off Ver
    2013 and 365 Pro Plus
    Posts
    56

    Re: Autofil pairs of rows

    Quote Originally Posted by AutoTV View Post
    Thanks biex ! It does work for that example, but I can't find out how to autofill those formulas for them to work over the 961 cases I need in the real-life dataset. Any ideas ?
    For that... it will be easy if you show us the real template that you use with minimal data or without data so we could adjust the formula with it.

    Then you could copy and paste the data on that template

  5. #5
    Registered User
    Join Date
    04-14-2020
    Location
    Mauritius
    MS-Off Ver
    2016
    Posts
    4

    Re: Autofil pairs of rows

    Original data is same as example (ABC) but from cell D4 to BM4 (31 individuals with 2 rows for each) over 651 lines (end at D654 to BM654).

    If I try to autofill your provided formulas down or right to fill up a 31x31 = 961 cells matrix, the formulas excels autofills with are no good.

    For example, your formula =J10-COUNTIF(D:E;3)
    will autofill down with =J11-COUNTIF(D:E;3)
    instead of with the desired =L12-COUNTIF(D:G;3)

  6. #6
    Registered User
    Join Date
    04-14-2020
    Location
    Mauritius
    MS-Off Ver
    2016
    Posts
    4

    Re: Autofil pairs of rows

    Hi everyone,

    I'm still looking for help on that one.
    In order to help you help me : ) I have attached an updated dataset with 2 new sheets :

    the sheet1 is still the same and explain what I want

    the sheet2 is a longer example with just a few data filled but the whole frame with number of id is there,

    the sheet3 is the results I'm looking for : to be able to autofill that matrix from one formula to autofill all.

    If you can find a formula that would fill sheet3 based on sheet2 dataset it would be awesome !


    Thanks again !
    Attached Files Attached Files

+ 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. Replies: 7
    Last Post: 10-17-2019, 12:00 PM
  2. Replies: 1
    Last Post: 08-19-2019, 08:38 AM
  3. How to identify triplet rows among pairs
    By sotplugy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2019, 06:31 PM
  4. convert the sweepstakes to their palindrome pairs and identify the twin pairs.
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2019, 07:59 AM
  5. [SOLVED] Keep rows between pairs of strings
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2018, 07:04 AM
  6. [SOLVED] macro to autofil formula based on number of rows on adjacent column
    By kramtelbuab in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-13-2013, 08:28 PM
  7. Autofil Sumproduct for different number of rows
    By mjhopler in forum Excel General
    Replies: 3
    Last Post: 09-13-2010, 04:25 AM

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