+ Reply to Thread
Results 1 to 1 of 1

If then better as macro or formula

  1. #1
    Registered User
    Join Date
    05-03-2021
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    365
    Posts
    1

    If then better as macro or formula

    It's been a while since I've done anything this complicated in excel.
    I need to create a field that will indicate a status based on some rules. Here's the fields I'm working with

    Name
    ID1
    ID2
    ID3
    ...
    ID9

    So name and ID9 will always have data the rest are variable and may be blank except at least 1 must have data. Here's the criteria (I think):

    If the lowest ID field has data (then that value becomes the ID for the name IDNAME) and then RESULT I NEED would be IDNAME +1 (named H-ID).

    See attached sheet for examples


    constraints:
    There will never be any blank ID# fields larger than one that ends up being IDName (i.e. if ID1 is not blank then all ID fields will have an entry. If ID7 is the first non-blank then only ID7, ID8 and ID9 will have data and ID9 could be the first non-blank and will NEVER be blank).
    There will never be duplicate IDName entries but H-ID/RESULT may be duplicated.

    Eventually I want to be able to sort these by IDName then any entries where H-ID equals IDName. See example

    I think can figure out the formulas/VBA stuff but my question is, will this be best written as a Macro/VBA or just a complicated formula? The sheet will be big but not HUGE (at most it will be under 5000 lines but it does have like 30 columns. I'm pretty sure VBA is the way to go but just want to see if maybe excel has made the If/then looping easier in a formula since the last time I did something like this.
    Attached Files Attached Files

+ 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] Error with a formula in my macro that is not allowing my macro to run
    By khanaran in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 01-29-2020, 12:42 PM
  2. Macro to paste formula in colK after a macro executed
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-20-2017, 08:39 PM
  3. Macro to paste formula to selection that replaces a formula with a named range.
    By Evan69 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-26-2017, 05:46 AM
  4. Problem with recording a macro with long formula - works in Excel but not in macro
    By tonybeo2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2015, 11:25 AM
  5. VBA Macro: Plugging an Array-Formula into a Cell and Dragging Formula Down Columns
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2013, 02:57 PM
  6. Macro: Applying formula to multiple cells in excel (formula editing)
    By city in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-27-2012, 06:41 AM
  7. Formula expected end of statement error, typing formula into cell as part of VBA macro
    By DavidGMullins@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2006, 03:05 PM

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