High Plains Grifter
Board Regular
- Joined
- Mar 9, 2010
- Messages
- 129
Hello people,
I created some time ago a spreadsheet that my team uses to keep a record of some work that we do. The basic format is that each task takes up a row of the spreadsheet, with an Id, Title etc and a cell containing any notes that people may add to the task. This notes field has text wrapping on it and people add new notes by entering the cell and typing Alt+Enter to insert a line break, then adding the date in dd/MM/yy format, their initials and a note.
In another column, I have a field called "Last Note" Which records the date of the last note to be entered on each task. This is used for sorting, filtering, calculations and so on. The problem is that as the spreadsheet is getting larger, I have noticed that it no longer performs as fast as it did and I think that the horrible formula may be a part of the problem. I am streamlining the workbook, but I cannot see a better way to get the last note than this behemoth of array based volatility:
=IF(Id="","",IFERROR(IFERROR(DATEVALUE(IF(ISNUMBER(1*MID(SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))),FIND("¬",SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))))+1,1)),MID(SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))),FIND("¬",SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))))+1,MIN(FIND(" ",MID(SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))),FIND("¬",SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))))+1,1000))-1,FIND(":",MID(SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))),FIND("¬",SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))))+1,1000))-1)),"")),DATEVALUE(LEFT(Notes,8))),Id))
Entered with Ctrl+Shift+Enter
I have replaced the Id and Notes fields with single cell named ranges to make the formula clearer (probably a lost cause, that!). An example value for the notes field might be this:
And the result of the formula would then be 42176, which is formatted to return the date "02/01/2013".
Any suggestions about how to get rid of the INDIRECT() volatility and simplify the whole thing?
Thanks for your time!
Mark
I created some time ago a spreadsheet that my team uses to keep a record of some work that we do. The basic format is that each task takes up a row of the spreadsheet, with an Id, Title etc and a cell containing any notes that people may add to the task. This notes field has text wrapping on it and people add new notes by entering the cell and typing Alt+Enter to insert a line break, then adding the date in dd/MM/yy format, their initials and a note.
In another column, I have a field called "Last Note" Which records the date of the last note to be entered on each task. This is used for sorting, filtering, calculations and so on. The problem is that as the spreadsheet is getting larger, I have noticed that it no longer performs as fast as it did and I think that the horrible formula may be a part of the problem. I am streamlining the workbook, but I cannot see a better way to get the last note than this behemoth of array based volatility:
=IF(Id="","",IFERROR(IFERROR(DATEVALUE(IF(ISNUMBER(1*MID(SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))),FIND("¬",SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))))+1,1)),MID(SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))),FIND("¬",SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))))+1,MIN(FIND(" ",MID(SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))),FIND("¬",SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))))+1,1000))-1,FIND(":",MID(SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))),FIND("¬",SUBSTITUTE(Notes,CHAR(10),"¬",SUM(IF(MID(Notes,ROW(INDIRECT("A1:A"&LEN(Notes))),1)=CHAR(10),1,0))))+1,1000))-1)),"")),DATEVALUE(LEFT(Notes,8))),Id))
Entered with Ctrl+Shift+Enter
I have replaced the Id and Notes fields with single cell named ranges to make the formula clearer (probably a lost cause, that!). An example value for the notes field might be this:
Code:
01/01/13 : MJG : This is the first note I have added to this task, it is a lovely note and makes me glow with pride.
02/01/13 : JRM : That last note was awful and the pride felt had nothing to do with reality and everything to do with medication.
And the result of the formula would then be 42176, which is formatted to return the date "02/01/2013".
Any suggestions about how to get rid of the INDIRECT() volatility and simplify the whole thing?
Thanks for your time!
Mark