+ Reply to Thread
Results 1 to 1 of 1

Get inputs to calculation based on column numbers if exist, if not use fixed value

  1. #1
    Registered User
    Join Date
    Houston, TX
    MS-Off Ver
    Excel 2003

    Get inputs to calculation based on column numbers if exist, if not use fixed value

    Hi Guys,

    I'm almost done with a workbook I'm working on but have one last thing I need to figure out. I am importing lots of data (10,000-60,000 rows, 5-15 columns) from a .txt file (this part works). Depending on which program the .txt file came from, the headings are called different things. I am trying to use a calculation that includes 6 of the columns so I created a drop-down menu for each part of the formula and the user can select which is the correct heading. (Ex: in my formula I might need "RPM" and the downloaded column is "Rotary RPM" so the user would select that). One of the programs I download .txt from does not record some of the parts of the calculation I need, so I added a column for fixed values to use in the formula in case they weren't included. I need a column to go through and calculate my formula and include the value from the correct column based on the heading selected in the drop down menu, or if the user selected "NOT RECORDED" which is part of the drop-down/returns col number 0 then to use the fixed value entered next to it.

    It's much easier to see if you open my workbook. I added a comment there explaining what the formula I'm using is and where the values come from.

    Basically the problem I'm having is that I can do it without VBA with a lot of cumbersome/slow IF,OR, VLOOKUPs...but with data sets at 10,000-60,000 rows I really need a faster way to do it and can't figure out a VBA to speed things up.

    Also, in my sample workbook I limited it to 500 lines of data to fit the size requirements, but normally would have a much larger data set.

    Any advice/specific code would be very much appreciated!
    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)

Tags for this Thread


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