Hi all, I have been working with LOOKUP formula and ran into small issue and need some expertise help...
The below formula skips a cell if there is a value in it.. in below example my cell starts at M2..however when I have a value there and the formula skips to M3 it picks up values under row 2 (so it takes A2, C2, H2)
Am I missing some $$s here in the formula? Any help would be much appreciated.. thanks so much!
LRDat2 = Sheets("Previous Day").Cells.Find("*", Cells(Rows.Count, Columns.Count), SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
LastRow2 = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
Set rng = Nothing
On Error Resume Next
With Sheets("data")
Set rng = .Range("M2:M" & LastRow2).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If Not rng Is Nothing Then rng.Formula = _
"=LOOKUP(REPT(""Z"",255),IF({1,0},"""",LOOKUP(2,1/(A2='previous day'!A$8:A$" & LRDat2 & ")/(C2='previous day'!C8:C" & LRDat2 & ")/(H2='previous day'!H$8:H$" & LRDat2 & "),'previous day'!M$8:M$" & LRDat2 & ")))"
Set rng = .Range("M2:M" & LastRow2)
rng.Value = rng.Value
End With
Bookmarks