+ Reply to Thread
Results 1 to 3 of 3

Macro to apply IF formula to next set of columns if condition is false

  1. #1
    Registered User
    Join Date
    02-13-2013
    Location
    Phila
    MS-Off Ver
    Excel for Mac 2011
    Posts
    25

    Macro to apply IF formula to next set of columns if condition is false

    Dear Forum,

    I am currently using an IF formula to retrieve sample names from a dataset (columns AI & AJ in the example workbook). I need to apply the same formula (or at least concept) to a dataset that has at least 100 times more columns. Writing an IF formula for the bigger dataset is near impossible. I will enormously appreciate if you can let me know of ways I can have a macro that basically accomplishes what the IF formula is doing but that doesn't require me to input all the values in the formula manually.

    The macro will basically have to ask in column AI if the value in column AG4 is equal to the value on L4, if true then retrieve sample name from column B4. If AG4 is different from L4, then look for value on next column M4 and retrieve value of next column C4 if true, etc. For column AJ, ask if AH4 is equal to V4, if true then retrieve B4, if AH4 is different from V4, then look for value on next column W4 and retrieve value of next column C4 if true, etc.

    Thanks a lot,
    Ale
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Macro to apply IF formula to next set of columns if condition is false

    See shorter formule with index and match


    Kind regards
    Leo
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-13-2013
    Location
    Phila
    MS-Off Ver
    Excel for Mac 2011
    Posts
    25

    Re: Macro to apply IF formula to next set of columns if condition is false

    Thanks a ton Leo, it works perfectly and accomplishes what I wanted!

    Cheers,
    Ale

+ 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: 3
    Last Post: 03-24-2015, 07:42 AM
  2. Need to Apply two different condition in single formula to a Timelog Sheet
    By Prashant_Shinde in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 03-24-2015, 06:59 AM
  3. [SOLVED] Not sure where to put false condition within ISNUMBER formula
    By lukela85 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2013, 02:12 PM
  4. How to apply if condition for the autofilter criteria(excel VBA Macro)
    By chakravarthysm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2013, 09:32 AM
  5. [SOLVED] Need to apply individual True/False Value, to Multi-Cell Ratio Count Formula
    By James_D in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-04-2013, 03:55 PM
  6. Formula to apply to multiple worksheets when a condition is met.
    By RunHard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-03-2009, 03:06 AM
  7. Replies: 3
    Last Post: 03-06-2005, 12:00 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