+ Reply to Thread
Results 1 to 5 of 5

Finding specific cells adjacent value in formula

  1. #1
    Registered User
    Join Date
    04-14-2021
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    3

    Finding specific cells adjacent value in formula

    Hello,

    I am making a macro to find the percentage value of a larger number. So for example I have a value in cell C39. In the D column I want to take the value of C2, divided by $C$39, and display it in D2. I would drag that down all the way down to display all the percentages that add up to 100%.

    This part is easy, the problem is that the amount of rows that can populate the sheet can vary so I can't just select $C$39. I would imagine I need to make the equation where I find the word "Total" in B39, then select the cell to the right of it C39 as my value to divide against.

    Not sure if that made sense, is this feasable? I'm trying to make this sheet scalable so it works no matter how many rows there are.

  2. #2
    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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,031

    Re: Finding specific cells adjacent value in formula

    You’ve posted in the formula section and 3verything except the word macro suggests you’re using a formula. Which is it, please?
    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.

  3. #3
    Registered User
    Join Date
    04-14-2021
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    3

    Re: Finding specific cells adjacent value in formula

    I wasn't sure which section to put it in. I wasn't aware of any formula where I could add in a conditional statement like what I am describing which is why I was asking. Should a moderator move this to the macro/VBA section?

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,219

    Re: Finding specific cells adjacent value in formula

    I think you can do that with a formula. Please read the yellow banner at the top of the page and attach a sample file.

  5. #5
    Registered User
    Join Date
    04-14-2021
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    3

    Re: Finding specific cells adjacent value in formula

    I can't attach the specific file due to company policy. After researching, I believe I need to do something with the range offset coding. This probably should be moved to the VBA forum. Anyway this is what I currently have.
    Please Login or Register  to view this content.
    The code selects B1-C1 range. I then do ctrl+shift + down to select everything in that column. What I then want to do is offset that selection by 1 and select everything but that last row. In this code it selects up to B32:C32 but i am trying to have it just offset, not have specific cells. I then sort those cells by largest to smallest. The very last cell is the "Total" of everything above it so that's why I want to offset everything

    Does this make sense?

+ 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. A formula for a specific text search then the sum of all adjacent cells
    By flyingpigeon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-01-2018, 01:44 AM
  2. [SOLVED] Formula to count adjacent cells containing specific text
    By BuddJ in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-17-2017, 10:14 PM
  3. [SOLVED] Add in a formula into specific selected non adjacent cells
    By ATOP in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-18-2016, 05:52 AM
  4. [SOLVED] How to treat specific text as zero in a formula for finding LARGE numbers from cells
    By masud_jahan in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-26-2016, 11:46 AM
  5. Finding duplicates and adding their adjacent cells
    By trier in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2014, 02:58 AM
  6. [SOLVED] Macro for finding out specific row and printing JD in the adjacent colum
    By meezadahsra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-03-2013, 06:28 AM
  7. Finding min/max of adjacent data in a range of cells
    By Paul987 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-15-2005, 03:02 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