Forum Discussion
Find last occurrence
Dear.
I need to have a VBA Script to find last occurrence date of value in excel... I have list of items in Column H and have generated a list of unique from that in column M... Date column in B...
I want to fetch last occurrence date of the items in Column M in column N please...
6 Replies
- NikolinoDEPlatinum Contributor
Since it absolutely must be in VBA :), here is a simple example in the included file.
Maybe it will help in your project.
I wish you lots of fun and success with Excel.
- shahzad_afzal_pkCopper ContributorHi;
Just wanted to represent my scenario... I have a sorted list of unique from a column (Column M), I want to display last billed date of after matching from the column of data (Column M to Column H) with the date column (Column B)...
Column H has the data from which i have created the column M...
Attached sheet is just giving today's date after any input of data...
- OliverScheurichGold Contributor
An alternative could be Power Query. You can add data into the blue dynamic table. Then click in any cell of the green table and right-click with the mouse and refresh.
- NikolinoDEPlatinum Contributor
There are so many possibilities without VBA.
Various formula combinations can lead to the goal,
such as VLOOKUP, INDEX, MAX,MIN, INDEX...enclosed is an example inserted in the data.
Hope I was able to help you with this info.
I know I don't know anything (Socrates)
- PeterBartholomew1Silver Contributor
No doubt you do need a VBA solution but I am curious to know why when there are simple worksheet formulas available to perform the same task.
= XLOOKUP(distinctItems, sales[Items],sales[Dates],"",0,-1)- shahzad_afzal_pkCopper ContributorHi;
I have all lookup and related formulas in the sheet... Due to huge data, sheet is now touching 28MB... Need to migrate to VBA to improve sheet calculation time...