+ Reply to Thread
Results 1 to 15 of 15

Issues with dragging formula down after multiple range of cells are referenced

  1. #1
    Registered User
    Join Date
    12-14-2021
    Location
    Bangkok
    MS-Off Ver
    MS Office 365, Verision 16.55
    Posts
    52

    Issues with dragging formula down after multiple range of cells are referenced

    I have made a formula in column D that evaluate a range of cells and inputs the value 0 or 1. However, I the formula to be applied to more than 50,000 rows and manually doing that is not efficient. The formula actually spills itself since I used a range of value as reference. Any help to sort of apply the formula to all the cells would be very helpful.

    Essentially what I want to achieve with this formula is that if the number of independent directors (INDEP_DIRS/COLUMN C) is greater or equal to 3 in ALL of the years from 1995-2003 for a TICKER then it should show 1 otherwise 0. With this condition if you have any other formula suggestion would be great as well.

    Thanking you in advance.
    Attached Files Attached Files
    Last edited by Farhasnat; 07-14-2022 at 02:34 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Issues with dragging formula down after multiple range of cells are referenced

    ??

    Is this what you want?

    =SUMIF(B:B,M2,C:C)

    copied down.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    12-14-2021
    Location
    Bangkok
    MS-Off Ver
    MS Office 365, Verision 16.55
    Posts
    52

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Thank you for your reply.

    My apologies I should have been more clear my formula is COLUMN D is what I want which is returning the value of 1 if for ALL of the years (1995-2003) has values in COLUMN C >= 3 for each of the TICKERS (COLUMN A) - if yes then it should return the value of 1 otherwise 0.

    I have corrected my original post accordingly.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Issues with dragging formula down after multiple range of cells are referenced

    =COUNTIFS(A:A,A2,C:C,">=3")

    If not, please add some expected results.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-14-2021
    Location
    Bangkok
    MS-Off Ver
    MS Office 365, Verision 16.55
    Posts
    52

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Thanks but I am not counting anything here, I am returning the value of 0 or 1 based on condition. The expected the results and the formula I am using is already there in the sheet (COLUMN D) which I have already mentioned.. The issue here is I can't drag the formula cause its a spill

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Issues with dragging formula down after multiple range of cells are referenced

    This won't spill. If I understand correctly try this in D2 and double click the fill handle to copy all the way down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Even over 50,000 + rows this should be lightning fast.
    Last edited by FlameRetired; 07-14-2022 at 03:56 PM.
    Dave

  7. #7
    Registered User
    Join Date
    12-14-2021
    Location
    Bangkok
    MS-Off Ver
    MS Office 365, Verision 16.55
    Posts
    52

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Thank you this exactly gets me somewhere what i want. But the the formula returns 1 in ANY year COLUMN C is >= 3. However, I am actually trying to get to the point where the formula should return 1 IF AND ONLY IF all of the YEARS from 1995-2003 has corresponding value of 3>= in COLUMN C.

    I have attached the file where i used the formula you advised
    Attached Files Attached Files

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Then try:

    =IF(COUNTIF(A:A,A2)=COUNTIFS(A:A,A2,C:C,">=3"),1,0)

    If not, upload a MUCH smaller file showing expected answers.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-22-2022
    Location
    India
    MS-Off Ver
    Microsoft office Home and Student 2019
    Posts
    61

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Hi,
    Try this.

    =IFERROR(IF(AND(MATCH(B2,$M$2:$M$10,0)>0,C2>=3),1,0),0)

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Quote Originally Posted by Farhasnat View Post
    Thank you this exactly gets me somewhere what i want. But the the formula returns 1 in ANY year COLUMN C is >= 3. However, I am actually trying to get to the point where the formula should return 1 IF AND ONLY IF all of the YEARS from 1995-2003 has corresponding value of 3>= in COLUMN C.

    I have attached the file where i used the formula you advised
    Sorry. I misunderstood. In that case try replacing that formula with
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    FYI: This part of the formula INDEX(FREQUENCY(C2,3-1/10^7),2) will take care of the >=3 part since the second 'bin' 2 in FREQUENCY will count all values greater an amount slightly less than 3. This would include 3.

  11. #11
    Registered User
    Join Date
    12-14-2021
    Location
    Bangkok
    MS-Off Ver
    MS Office 365, Verision 16.55
    Posts
    52

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Thank you so much. This performs exactly as I wanted. Appreciate your help

  12. #12
    Registered User
    Join Date
    12-14-2021
    Location
    Bangkok
    MS-Off Ver
    MS Office 365, Verision 16.55
    Posts
    52

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Thank you. This formula still sort of picks up return value of 1 even if COLUMN C has >= for single year ONLY. But thank you again for your help

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Quote Originally Posted by Farhasnat View Post
    Thank you so much. This performs exactly as I wanted. Appreciate your help
    Who are you talking to???

  14. #14
    Registered User
    Join Date
    12-14-2021
    Location
    Bangkok
    MS-Off Ver
    MS Office 365, Verision 16.55
    Posts
    52

    Re: Issues with dragging formula down after multiple range of cells are referenced

    Quote Originally Posted by Glenn Kennedy View Post
    Who are you talking to???
    You actually, probably my tagging wasn't right. The last formula you have provided got me exactly what i wanted. Thank you again

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

    Re: Issues with dragging formula down after multiple range of cells are referenced

    You didn't do any tagging. All you need to do in future is mention the member at the start of your post (e.g. @Glenn Kennedy), then it's clear as glass.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Dragging cells to other referenced cells gives REF ERROR.
    By iturriko in forum Excel General
    Replies: 2
    Last Post: 11-29-2018, 10:00 AM
  2. Getpivotdata - dragging issues
    By NoWizkid in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-30-2018, 10:02 AM
  3. [SOLVED] Dragging cells changes range in formula of locked cell; can I prevent this?
    By exceln00b22 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2014, 08:19 PM
  4. Replies: 1
    Last Post: 04-30-2012, 10:01 PM
  5. Dragging Formulas - Skipping Referenced Cells
    By markpratt in forum Excel General
    Replies: 2
    Last Post: 11-03-2011, 10:03 AM
  6. Dragging & Dropping a range of cells
    By mge in forum Excel General
    Replies: 7
    Last Post: 11-02-2010, 04:48 AM
  7. Replies: 3
    Last Post: 08-18-2005, 11:05 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