simple excel equation help

Brandon21

New Member
Joined
May 1, 2013
Messages
41
So, if you were to look at this spreadsheet you would see that there are some repeating formations. There are two MaA formations listed for well RA-0001. This is because there were two interpreters for this formation, named 1 and 2. In total in this spreadsheet there are 6 interpreters, 1 through 6. 1 being the best, 6 being the worst.

I need to create a worksheet that only has one interpreter for each formation.

I cant just filter out interpreters 2 through 6 though because interpreter 1 may not have picked every formation. (as you can see in bold, MaC1 was only picked by interpreter 2).

What I need to be able to do is select the best one interpreter for each specific formation for each specific well. (there are about 500 wells or so).

I have organized the data so that it is by well, formation, then interpreter (smallest to largest) aka (best to worst for me).

I was wondering if there was some way I could delete the row of any repeating formation.

Is there an equation I could write? I cant figure it out.

I just want to ensure that I have the best interpreter for each formation, and delete the information of any other interpreter for that formation. simple enough, but i cant figure it out.

Any help would be great! thanks.






WELL NAMEFORMATIONINTERPRETER
RA-0001MaA1
RA-0001MaA2
RA-0001MaA_L1
RA-0001MaA_L2
RA-0001MaA_Mrk11
RA-0001MaA_Mrk12
RA-0001MaA_Mrk21
RA-0001MaA_Mrk22
RA-0001MaB1
RA-0001MaB2
RA-0001MaB_Mrk11
RA-0001MaB_Mrk12
RA-0001MaB_Mrk21
RA-0001MaB_Mrk22
RA-0001MaB_Mrk31
RA-0001MaB_Mrk32
RA-0001MaC1
RA-0001MaC2
RA-0001MaC12
RA-0001MaC21
RA-0001MaC22
RA-0001MaC23
RA-0001MaC32
RA-0001MaC42
RA-0001MaD1
RA-0001MaD2
RA-0001MaD_Mrk11

<colgroup><col width="124" span="3" style="width:93pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
is there like an IF AND statment I could do?
A formula cannot physically delete a row, so you are going to need a macro in order to modify your original data that way.. Give this one a try...

Code:
Sub KeepBestInterpretter()
  Dim LR As Long
  LR = Cells(Rows.Count, "A").End(xlUp).Row
  Range("B2:B" & LR) = Evaluate("IF(B2:B" & LR & "=B1:B" & LR - 1 & ","""",B2:B" & LR & ")")
  On Error Resume Next
  Range("B2:B" & LR).SpecialCells(xlBlanks).EntireRow.Delete
  On Error GoTo 0
End Sub

HOW TO INSTALL MACROs
------------------------------------
If you are new to macros, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are done. To use the macro, go back to the worksheet with your data on it and press ALT+F8, select the macro name (KeepBestInterpretter) from the list that appears and click the Run button. The macro will execute and perform the action(s) you asked for. If you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm).
 
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,618
Members
449,238
Latest member
wcbyers

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top