+ Reply to Thread
Results 1 to 5 of 5

Test multiple variables in different columns

  1. #1
    Registered User
    Join Date
    10-21-2015
    Location
    New York
    MS-Off Ver
    MS Office 2013
    Posts
    95

    Test multiple variables in different columns

    Hi Guys,

    I need help figuring out formula or perhaps macro?

    I have a table: (a,b,c)

    3 2020 4.2
    4 2017 5.0
    2 2019 5.2
    1 2025 2.7
    3 2022 5.6
    1 2026 2.9


    I need to construct a table that would get a value from a column C, test it and if true, paste the corresponding value from column B. I also need to test the column A. So my table should look like this:


    Each column gets a weight/value of 1.

    Row 1:

    A1 B1 C1 D1 E1 F1 G1 H1 I1 etc...
    2025 2025 2025 2026 2026 2026

    Row 2:
    A1 B1 C1 D1 E1 F1 G1 H1 I1 etc...
    2019 2019 2019 2019 2019 2019

    Row 3:
    A1 B1 C1 D1 E1 F1 G1 H1 I1 etc...
    2020 2020 2020 2020 2020 2022 2022 etc..


    The first value for "1" in column C is 2.7. So I need to paste 2025 for Row 1 until the condition is true (until 2.7 is greater than A1 (which has a value of 1) and B1, (A1+B1=2). Ideally, if it is greater than the whole number I would need to paste it. So even though 2.7 is less than 3 (A1+B1+C1), I would still need to have 2025 in column C.

    Then the next value in the table for 1 is 2.9. So I need to add 2.7+2.9 and do the same thing going forward...

    Some idea for rows 2,3,4 etc..

    Any ideas? Please help!

    Thanks a lot!
    Last edited by I.am.Rustam; 10-10-2016 at 07:35 PM.

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

    Re: Test multiple variables in different columns

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Quang PT

  3. #3
    Forum Contributor
    Join Date
    06-28-2016
    Location
    Pennsylvania, USA
    MS-Off Ver
    2013
    Posts
    308

    Re: Test multiple variables in different columns

    If I understand correctly,

    Your A column is the Row number.
    Your B column is the desired output (if it's column() value is less than the corresponding C value)
    Your C column determines when to change the B value.

    You'd probably be better off with a macro for this particular problem, since the only solutions I can think of involve array formulas, and given how exponentially large this table will get, that's probably a bad idea...

    Unfortunately, I am not well versed in macros, so hopefully someone else can be of assistance.

  4. #4
    Registered User
    Join Date
    10-21-2015
    Location
    New York
    MS-Off Ver
    MS Office 2013
    Posts
    95

    Re: Test multiple variables in different columns

    Hi bebo021999,

    Thanks for your reply. I've attached a sample sheet. Thanks!
    Attached Files Attached Files
    Last edited by I.am.Rustam; 10-10-2016 at 09:33 PM.

  5. #5
    Registered User
    Join Date
    10-21-2015
    Location
    New York
    MS-Off Ver
    MS Office 2013
    Posts
    95

    Re: Test multiple variables in different columns

    TheN,

    Yes, that's right. I believe macro will solve the problem and will be more efficient.

    Thanks!

+ 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. Insert multiple columns on variable places
    By Lode88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-24-2015, 05:09 AM
  2. Summing variable values across variable sheets in multiple columns
    By rdelosh74 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2014, 02:16 PM
  3. Sum different columns from multiple worksheets..multi variable
    By berbchid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-03-2013, 10:33 AM
  4. Replies: 2
    Last Post: 06-15-2012, 05:34 PM
  5. Replies: 4
    Last Post: 01-14-2011, 09:30 PM
  6. Need to test for multiple variables in columns
    By donoisbono in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2007, 03:18 PM
  7. [SOLVED] how do I filter for 1 variable in multiple columns
    By California in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2005, 07:06 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