+ Reply to Thread
Results 1 to 32 of 32

Formula for intersection of rows and columns

  1. #1
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Formula for intersection of rows and columns

    Hello. I have a table with a list of data, the desired data of which I can turn on and off using true and false. I am interested in whether there is a formula with which I can find the intersection of rows and columns (which I selected using true) and so that with the result found I can perform various actions (for example, if there is a number, then some mathematical operations). It is desirable that the intersection of rows and columns, and then interaction with the found results, be carried out using one function.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,090

    Re: Formula for intersection of rows and columns

    Welcome to the forum.


    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    Here is the file
    Excel.xlsx

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    First, you will need to unmerge cells.

    Your first requirement needs this:

    =FILTER(A2:A25,B2:B25)

    Your second requirement is unclear to me. Please manually fill in your expected results in the section starting in green so that we can test possible solutions.
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    Thank you for your response. Here is the updated file. Please read all the comments. If you have any questions, please ask.
    Excel updated.xlsx

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    There are no new comments. I had already read the comments that were there and asked you to clarify them. You haven't done so.

    Please explain the results that you are showing - where do they come from and why?

    You will still need to get rid of merged cells.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    I already gave you a formula for the first issue:

    =FILTER(A2:A25,B2:B25)

    See the workbook attached to post #4.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    We got 5 because Analytics intersects with five modules, each of which has 1 at the intersection.
    Where?

    Analytics seems to intersect with all modules:

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    G
    H
    1
    Modules(columns) Analytics
    2
    d3
    1
    3
    Administration
    1
    4
    Obstetrics
    1
    5
    Pharmacy
    1
    6
    BARS - Healthcare Monitoring
    1
    7
    BARS.STAR
    1
    8
    Vaccination
    1
    9
    VIMIS RF AKiNEO
    1
    10
    VIMIS RF Oncology
    1
    11
    VIMIS RF Prevention
    1
    12
    VIMIS RF CVD
    1
    13
    HMP
    1
    14
    Outside ARM
    1
    15
    Military registration
    1
    16
    Hospital physician
    1
    17
    Diagnostics
    1
    18
    Dispensary registration
    1
    19
    Remote monitoring
    1
    20
    Health diary
    1
    21
    Unified registry
    1
    22
    User information support
    1
    23
    IPRA
    1
    24
    IEMC
    1
    25
    Call center
    1
    Sheet: Sheet1

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    OK - worked it out.

    =FILTER(D18:D24,E18:E24)

    =LET(a,SUM(FILTER(FILTER($H$2:$N$25,$H$1:$N$1=D4),$B$2:$B$25))*3,a*1+TEXTAFTER($E$15,"-"))
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    Spill version:

    =BYROW(D4#,LAMBDA(r,IFERROR(LET(a,SUM(FILTER(FILTER($H$2:$N$25,$H$1:$N$1=r),$B$2:$B$25))*3,a*1+TEXTAFTER($E$15,"-")),"")))
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    All-in-ine solution:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    In reality, all modules and positions intersect according to the table, so there is truth and falsehood there, so that the user can choose which modules and positions, as well as the level of complexity he needs. The user can generally choose all positions and modules, then there will be a larger list of intersections.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    Have you looked at the ultimate solution in post #11?

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  14. #14
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    I looked at your answer. But according to the condition, there should be only one formula. As I said earlier, the formula should display all selected positions (marked as true) in the blue cell range, find their intersection with the selected modules (marked as true) and in the range starting from the green cell should do mathematical calculations - the sum of all intersected values, multiply this sum by 3 and add 50% to it (if the complexity is selected as hard). All these actions should be performed by one formula, there cannot be several.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    All these actions should be performed by one formula, there cannot be several.
    There is only one formula in post #11. It spills all of the results into the cells to the right and below. The formula is in D4. If you delete it, all of the results will go with it.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    Just to clarify, this is ONE FORMULA:

    Please Login or Register  to view this content.
    It goes into D4. Open the workbook attached to see it working.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    I apologize, I was just given this task and maybe I didn't explain it to you correctly. Is it possible to solve this with one function, is there one that will find intersections and also perform mathematical operations?

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    No, there is not.

    What is wrong with the formula? It works exactly the same as a function would do.

  19. #19
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    No, everything is fine with the formula. One thing is interesting, why does the answer for Analytics come out as 15.5, there it should be 22.5. And for Systems Analyst it is also different, 30.5 instead of 45. And one more thing, when I change any value, it immediately writes an error #NAME?

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    Slight change to the formula:

    Please Login or Register  to view this content.
    when I change any value, it immediately writes an error #NAME?
    Your forum profile says that you are using 365, so the formula has been built for that version of Excel. Is your 365 completely up-to-date? Or are you using something else?
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    I usually use 365, but at the moment I have LTSC 2021 version

  22. #22
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    Well, you should have mentioned that in post #1.

    Sorry, my formula was built for 365 - it won't work in thhe version you have.

    It can be done in your version, but NOT in oine formula.

  23. #23
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    Ok, will this formula work with google sheets?

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    For 2021

    In D4:

    =FILTER(D18:D24,E18:E24)

    In E4 copied down:

    =IFERROR(LET(a,SUM(FILTER(FILTER($H$2:$N$25,$H$1:$N$1=D4),$B$2:$B$25))*3,a*(1+MID($E$15,FIND("-",$E$15)+1,4))),"")

    Ok, will this formula work with google sheets?
    Not without tweaking, I suspect. I've given you a 2021 solution.

    Try it yourself in GoogleSheets.

  25. #25
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    Is it possible for all of this to be in cell D4?

  26. #26
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    Not in Excel 2021, no. Please read what I am telling you carefully.

    This will work in D4 in GoogleSheets:

    Please Login or Register  to view this content.
    I have now solved this for you three times.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  27. #27
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,677

    Re: Formula for intersection of rows and columns

    Quote Originally Posted by Extend View Post
    Is it possible for all of this to be in cell D4?
    What to be in a single cell?
    Do you mean all text string ( 4 cells, in this sample) combination in a cell?
    Quang PT

  28. #28
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    No, they mean one single spill formula, which I have provided for both 365 (post #20) and GoogleSheets (post #26) above.
    Last edited by AliGW; 08-31-2024 at 10:01 AM.

  29. #29
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,677

    Re: Formula for intersection of rows and columns

    For such a complex requirement, if you want it to be usable in Excel 2007+, you should consider using a UDF (User Defined Function) in D4 and copying it to the entire range.

  30. #30
    Registered User
    Join Date
    08-30-2024
    Location
    Georgia
    MS-Off Ver
    365
    Posts
    11

    Re: Formula for intersection of rows and columns

    Thank you very much for helping me.

  31. #31
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula for intersection of rows and columns

    You're welcome.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  32. #32
    Registered User
    Join Date
    09-08-2022
    Location
    Germany
    MS-Off Ver
    2021
    Posts
    8

    Re: Formula for intersection of rows and columns

    A very (maybe too?) simple approach: Write into AliGW's file of post #20
    F26: 10%
    F27: 25%
    F28: 50%
    G26: Easy
    G27: Medium
    G28: Hard
    H26: =3*SUMPRODUCT(--$B$2:$B$25,H$2:H$25)*(1+$F26)
    and copy H26 to H26:N28.
    To make it easy for future extensions you can move the three new rows up: select rows 26:28, press CTRL + X and insert these rows on top.
    This should work for all Excel versions, Google sheet, Lotus1-2-3, and maybe even Visicalc :-)
    Last edited by Volker_L; 09-01-2024 at 10:18 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. How to select rows and columns where intersection cells are empty
    By JOAO12 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-14-2021, 06:51 PM
  2. [SOLVED] Intersection of 2 Perpendicular Lines - Apparent Error in Intersection Coordinates
    By Paddy_Bear in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 10-03-2018, 03:36 AM
  3. Replies: 1
    Last Post: 07-16-2013, 06:41 PM
  4. Finding intersection of columns and rows by macro
    By AuroraBorealis87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2012, 10:43 AM
  5. Replies: 2
    Last Post: 01-12-2012, 01:25 AM
  6. intersection of two columns
    By Horst in forum Excel General
    Replies: 1
    Last Post: 11-01-2011, 08:23 AM
  7. Excel 2007 : Intersection between rows and columns
    By PedroFranco in forum Excel General
    Replies: 3
    Last Post: 07-07-2010, 10:46 AM

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