Find Last value in Group With Index Match

yoan6

New Member
Joined
Jul 1, 2014
Messages
27
Code:
For Each cl2 In Table2
       
    nom1 = Sheets("Date_Step").Cells(Step2_Row, Step2_Clm).Value
    nom2 = Application.WorksheetFunction.VLookup(nom1, Table11, 2)
    nom3 = Sheets("Date_Step").Cells(nom_Row, Nom_Clm).Value
    Total = Application.WorksheetFunction.CountIfs(Table10, nom2, Table12, nom3)
    
    cl2.FormulaArray = _
        "=INDEX(Log_WK!C[-7],MATCH(Date_Step!RC[-6],IF(VLOOKUP(RC[-1], Correspondance!R[" & i & "]C[-7]:R[" & j & "]C[-6], 2, FALSE)=Log_WK!C[-5],Log_WK!C[-4]),0)" & [B]Total[/B] & " [B]-1[/B])"
       
    If Not IsError(cl2) Then
        Result = cl2
    Else
        Result = ""
    End If
        
    Sheets("Date_Step").Cells(Date2_Row, Date2_Clm) = Result
    
    nom_Row = nom_Row + 1
    Date2_Row = Date2_Row + 1
    Step2_Row = Step2_Row + 1
    i = i - 1
    j = j - 1
       
Next cl2

With the array formula I tried to find the last value.

I had look an internet and I found a page telling me to add Total-1 (in bold type) but it does not work.

Do you have an idea on how I can do it?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

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