Indexing Problem (of sorts)

denzo36

Board Regular
Joined
Sep 22, 2019
Messages
218
Office Version
  1. 365
Platform
  1. Windows
Hi folks,

I have a list of policy numbers, the policy version associated with it and whether that policy version had a claim or not. A policy can have multiple policy versions which go in sequential order. You can see from my data below, each row has policy number, policy version and whether that version has had a claim.

What I'm trying to do is for each policy, only keep the policy versions that either have the claim on them and the policy versions after that version. I want to delete the versions of each policy before the version where the claim happened and only keep the policy version on and after the version where the claim occurred.

You can see from the screen shot below, my desired result (the 1 and 0 are arbitrary in terms of labelling) - I would like something like that so I can filter this column by the 0 and delete them. So for each policy I'd like the index to only count 1 on the version that had the claim and any version after that but a 0 for the versions before the claim.

Hopefully that's making sense.

Any ideas?

1670322259978.png
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
How about
Excel Formula:
=COUNTIFS(A$2:A2,A2,B$2:B2,"Y")>0
this will return True/False rather than 1/0
 
Upvote 0
Solution
How about
Excel Formula:
=COUNTIFS(A$2:A2,A2,B$2:B2,"Y")>0
this will return True/False rather than 1/0
Fluff thank you so much, that has worked a treat.

Much appreciated!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Hi Fluff ,
Could you please help me to resolve this excel VBA problem? The following VBA excel sheet is used in windows XP , its working fine on XP but when I open the same sheet on windows 10 , Run-time error 429 active component can't created object error pops-up. When debug it shows " Set Objfso = CreateObject("UserAccounts.CommonDialog")"
"
Set Objfso = CreateObject("UserAccounts.CommonDialog") <<<--------- This is the place error pops-up

'ObjFSO.Filter = "|Text Documents|*.txt"

Objfso.FilterIndex = 3

Objfso.InitialDir = "c:\myscripts"

InitFSO = Objfso.ShowOpen

If InitFSO = False Then
msgbox "Error: Please select a file!"
End
Else
msgbox "You selected the file: " & Objfso.Filename
sfname = Objfso.Filename
sFileName = Split(sfname, "\")(UBound(Split(sfname, "\")))

End If

Workbooks.OpenText Filename:= _
Objfso.Filename, Origin:=437, StartRow:= _
1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(1, 2), _
TrailingMinusNumbers:=True


I'm not a professional IT Person. Could you please help me.
Many thanks
Kasun
 
Upvote 0
As this has nothing to do with the original question, you need to start a thread of your own.
Also please do not include you email address (or any other contact info) in you posts.
Thanks
 
Upvote 0

Forum statistics

Threads
1,215,798
Messages
6,126,968
Members
449,350
Latest member
Sylvine

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