Auto add last entered data in same row

Detectiveclem

Active Member
Joined
May 31, 2014
Messages
320
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Hi can anyone help with a formula which will allow the last date entered in a row to be captured in the last date entered cell (E.G. Cell A2) And the last Item entered to appear in the last item entered cell (EG Cell B2).

Please see the attached sample with the data shown in green for illustration purposes to show the data I want captured.

So for example at present A4 shows 10/01/2021 and B4 shows Application but if further dates or items are entered in G4 / H4 then A4 and B4 change to show the latest information.

I hope I have explained this sufficiently.

Your genius would be greatly appreciated.


7D4C8C41-C0E6-47BA-A71E-5D90C100CF86_4_5005_c.jpeg
 
ok, try this.

oAAQqn69R4ikZ1sZ6xst_work.csv
ABCDEFGHIJKLMNOPQR
1Date of last transactionLast ItemDateItemMethodCompleteDateItemMethodCompleteDateItemMethodCompleteDateItemMethodComplete
203.02.2021Email01.01.2021LetterPostNO03.02.2021EmailExternal emailYES
310.01.2021Application10.01.2021ApplicationCourierYES
425.03.2021Application12.02.2021EmailExternal emailNO14.02.2021LetterPostNO25.03.2021ApplicationCourierYES
525.06.2021Letter12.02.2021LetterPostNO05.03.2021ApplicationCourierNO30.03.2021LetterPostNO25.06.2021LetterPostYes
Sheet5
Cell Formulas
RangeFormula
A2:A5A2=AGGREGATE(14,6,ISNUMBER(C2:R2)*(C2:R2),1)
B2:B5B2=XLOOKUP(AGGREGATE(14,6,ISNUMBER(C2:R2)*(C2:R2),1),C2:R2,OFFSET(C2:R2,0,1))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:R5Expression=A$1:R$1="Date"textNO


That done, I will try doing transformation in PQ into proper data set.
That will only require to transform ur data into a table with a specific name, or I'll have do a small Mcode editing (nothing hard, just changing the source data)
 
Upvote 0

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.
Thank you, I will try this, but will have to change your formula to suit my worksheet but can't do it until tomorrow morning as our access server has gone down for updates. Thank you and i'll let you know how I get on tomorrow. I also look forward to seeing what you come up with re the proper dataset.

Thank you so much again.
 
Upvote 0
ok, try this.

oAAQqn69R4ikZ1sZ6xst_work.csv
ABCDEFGHIJKLMNOPQR
1Date of last transactionLast ItemDateItemMethodCompleteDateItemMethodCompleteDateItemMethodCompleteDateItemMethodComplete
203.02.2021Email01.01.2021LetterPostNO03.02.2021EmailExternal emailYES
310.01.2021Application10.01.2021ApplicationCourierYES
425.03.2021Application12.02.2021EmailExternal emailNO14.02.2021LetterPostNO25.03.2021ApplicationCourierYES
525.06.2021Letter12.02.2021LetterPostNO05.03.2021ApplicationCourierNO30.03.2021LetterPostNO25.06.2021LetterPostYes
Sheet5
Cell Formulas
RangeFormula
A2:A5A2=AGGREGATE(14,6,ISNUMBER(C2:R2)*(C2:R2),1)
B2:B5B2=XLOOKUP(AGGREGATE(14,6,ISNUMBER(C2:R2)*(C2:R2),1),C2:R2,OFFSET(C2:R2,0,1))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:R5Expression=A$1:R$1="Date"textNO


That done, I will try doing transformation in PQ into proper data set.
That will only require to transform ur data into a table with a specific name, or I'll have do a small Mcode editing (nothing hard, just changing the source data)
Can you tell me what the numbers 14 and 6 represent after the aggregate? Also do I need to do anything with the conditional format information you included? Sorry for being such a novice.
 
Upvote 0
Hi there.
Here is the PQ solution:

oAAQqn69R4ikZ1sZ6xst_work.csv
BCDEF
14PQ
15IndexDateItemMethodComplete
16110.01.2021ApplicationCourierYes
17205.03.2021ApplicationCourierNo
18325.03.2021ApplicationCourierYes
19403.02.2021EmailExternal EmailYes
20512.02.2021EmailExternal EmailNo
21601.01.2021LetterPostNo
22712.02.2021LetterPostNo
23814.02.2021LetterPostNo
24930.03.2021LetterPostNo
251025.06.2021LetterPostYes
26
27Arrey formula for date per Item & date verification
28
29Item/MethodCourierExternal EmailPost
30Application25.03.2021
31Email12.02.2021
32Letter25.06.2021
33
34Power query dynamic solution (CTRL+ALT+F5) to refresh all data
35Last ItemLast DateComplete?
36Application25.03.2021Yes
37Email12.02.2021No
38Letter25.06.2021Yes
Sheet5
Cell Formulas
RangeFormula
C29:E29C29=TRANSPOSE(UNIQUE(Table6_2[Method]))
B30:B32B30=UNIQUE(Table6_2[Item])
C30:E32C30=LET( MaxIFSDate,MAXIFS(Table6_2[Date],Table6_2[Item],B30#,Table6_2[Method],C29#), ZeroDate,IF(MaxIFSDate=0,"",MaxIFSDate), ZeroDate)
Dynamic array formulas.


and also some spilled arrey report.

1st table:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table6"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"LP"}, "Attribute", "Value"),
    #"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Proper Headings", each Text.Remove([Attribute],{Character.FromNumber(48)..Character.FromNumber(57)})),
    #"Added Index" = Table.AddIndexColumn(#"Added Custom", "Index", 0, 1, Int64.Type),
    #"Removed Columns" = Table.RemoveColumns(#"Added Index",{"Attribute"}),
    #"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[#"Proper Headings"]), "Proper Headings", "Value"),
    #"Removed Columns1" = Table.RemoveColumns(#"Pivoted Column",{"Index"}),
    #"Filled Up" = Table.FillUp(#"Removed Columns1",{"Method", "Complete", "Item"}),
    #"Filtered Rows" = Table.SelectRows(#"Filled Up", each ([Date] <> null)),
    #"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"Date", type date}, {"Item", type text}, {"Method", type text}, {"Complete", type text}}),
    #"Capitalized Each Word" = Table.TransformColumns(#"Changed Type",{{"Item", Text.Proper, type text}, {"Method", Text.Proper, type text}, {"Complete", Text.Proper, type text}}),
    #"Sorted Rows" = Table.Sort(#"Capitalized Each Word",{{"Item", Order.Ascending}, {"Date", Order.Ascending}}),
    #"Added Index1" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1, Int64.Type),
    #"Removed Columns2" = Table.RemoveColumns(#"Added Index1",{"LP"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Removed Columns2",{"Index", "Date", "Item", "Method", "Complete"})
in
    #"Reordered Columns"

2nd table (referenced)
Power Query:
let
    Source = Table6,
    #"Grouped Rows" = Table.Group(Source, {"Item"}, {{"Max", each List.Max([Date]), type nullable date}}),
    #"Merged Queries" = Table.NestedJoin(#"Grouped Rows", {"Item", "Max"}, Table6, {"Item", "Date"}, "Table6 (3)", JoinKind.LeftOuter),
    #"Expanded Table6 (3)" = Table.ExpandTableColumn(#"Merged Queries", "Table6 (3)", {"Complete"}, {"Complete"}),
    #"Renamed Columns" = Table.RenameColumns(#"Expanded Table6 (3)",{{"Item", "Last Item"}, {"Max", "Last Date"}, {"Complete", "Complete?"}})
in
    #"Renamed Columns"
 
Upvote 0
also i figured out this way

oAAQqn69R4ikZ1sZ6xst_work.csv
GHIJK
29IndexDateItemMethodComplete
30344280ApplicationCourierYes
31544239EmailExternal EmailNo
321044372LetterPostYes
Sheet5
Cell Formulas
RangeFormula
G29:K29G29=Table6_2[#Headers]
G30:K32G30=INDEX(Table6_2,MATCH(MAXIFS(Table6_2[Date],Table6_2[Item],UNIQUE(Table6_2[Item])),Table6_2[Date],0),SEQUENCE(,COUNTA(Table6_2[#Headers]),1,1))
Dynamic array formulas.
 
Upvote 0
Thank you, but this all seems to complicated for me. Clearly you are an expert and I remain a novice. But I am keen to learn so thank you.
 
Upvote 0
I hope I did not scare you :D
and honestly, there are so many ways because I could not figure out the single-cell formula that I found on excelisfun to happen in dynamic arrays.
So in conclusion I may know something, but to be an expert, true one, I still need to learn sh...t tons of stuff :(
 
Upvote 0
I hope I did not scare you :D
and honestly, there are so many ways because I could not figure out the single-cell formula that I found on excelisfun to happen in dynamic arrays.
So in conclusion I may know something, but to be an expert, true one, I still need to learn sh...t tons of stuff :(
Hi again Radoslaw,

Sorry for the delay in replying but I have been trying to make your formulas work for me.

Although the cells I am using are different from the example I provided the formula works perfectly in the cell in column marked date of last transaction which in my actual workbook is column M (First cell being M6) =AGGREGATE(14,6,ISNUMBER(O6:AD6)*(O6:AD6),1)........So this works perfectly.

However the second formula as amended by me to suit the same range as above =XLOOKUP(AGGREGATE(14,6,ISNUMBER(O6:AD6)*( O6:AD6),1),O6:AD6,OFFSET(O6:AD6,0,1)) comes up with an error #NAME?

In my actual spreadsheet this is at column N

The relevant data when entered (I.E. In the Item headed columns) would be found in columns Q, V, AA and AF.

Can you assist with this please?

Further I have no idea what to do with this further formula you provided and so far have not used it. Should I use it, if so how do I use it (please note that it still shows the range A1:R5 whereas my actual data starts from M6:AH 5000

Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:R5Expression=A$1:R$1="Date"textNO

Please help me if you are able to.

Thank you
 
Upvote 0
Hi again, I have provided the exact cell references I am trying to achieve this formula to auto populate the cells between N6:N5000 with the last ‘Item’ entered in the same row at columns Q, V, AA or AF etc. If nothing is entered in these cells on a particular row then the N cell needs to remain blank (For example as seen at Row 10).

Please see the screen shot below.

Your help would be greatly appreciated.
Screen shot 22 June 2021.png
 
Upvote 0
How about
+Fluff 1.xlsm
MNOPQRSTUVWXYZAAABACAD
5Date of last transactionLast ItemDateItemMethodCompleteDateItemMethodCompleteDateItemMethodCompleteDateItemMethodComplete
602/03/2021Email01/01/2021LetterPostNO02/03/2021EmailExternal emailYES
710/01/2021Application10/01/2021ApplicationCourierYES
825/03/2021Application12/02/2021EmailExternal emailNO14/02/2021LetterPostNO25/03/2021ApplicationCourierYES
925/06/2021Letter12/02/2021LetterPostNO05/03/2021ApplicationCourierNO30/03/2021LetterPostNO25/06/2021LetterPostYes
Master
Cell Formulas
RangeFormula
M6:M9M6=AGGREGATE(14,6,O6:AD6,1)
N6:N9N6=INDEX(P6:AE6,MATCH(M6,O6:AD6,0))
 
Upvote 0

Forum statistics

Threads
1,216,225
Messages
6,129,596
Members
449,520
Latest member
TBFrieds

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