Dear Sir
Please refer to the enclosed spreadsheet and suggest a formula to return value in row 40
Thanks!
Dear Sir
Please refer to the enclosed spreadsheet and suggest a formula to return value in row 40
Thanks!
Please try at After
D40 copy to the right
=IFERROR(ROWS(D1:D37)-MATCH(2,INDEX(1/D1:D37,)),)
D41 copy to the right
=IFERROR(ROWS(D1:D37)-MATCH(1,INDEX((ROW($E$1:$E$37)>MATCH(2,INDEX(1/D1:D37,)))/(E1:E37>0),),),)
Hi
Apologies for the delay in reply.
I have tested the suggested formula with real data and it seem to work.
However as data are updated, the formula did not cater for that.
I have incorporated the formula in the accompanying revised excel and explained the issue.
Appreciate any further input.
Thanks a lot!
Please try at sheet After
D40
=IFERROR(ROWS(D1:D38)-MATCH(2,INDEX(1/D1:D38/(ROW(D1:D38)<>ROWS(D1:D38)),))-1,)
D41
=IFERROR(ROWS(D1:D38)-1-MATCH(1,INDEX((ROW(D1:D38)>MATCH(2,INDEX(1/D1:D38/(ROW(D1:D38)<>ROWS(D1:D38)),)))/(OFFSET(D1:D38,,SIGN(MOD(COLUMNS($D40:D40)-2,3)-1.5))>0)/(ROW(D1:D38)<>ROWS(D1:D38)),),),)
Copy both to the right.
The formula is cover row 38, you can select row 38 and insert row or press Ctrl + when you need to add more data.
Hi
The formula is brilliant.
However I do find it difficult to apply in reality, which I explained in the enclosed spreadsheet.
I am sorry this is getting complicated, and not sure if you want to continue to work on it, but your help so far is much appreciated.
The formula in post#4 is to compare a group with 2 columns and 1 empty column between each group,
That where I use this "SIGN(MOD(COLUMNS($D40:D40)-2,3) -1.5))" for use the same formula to copy to the right.
Now you want to compare a group with 4 columns with no space column in between, that changes everything.
Will these changes? compare column D with E and Column C with F ?Group A
1 and 34 are companion numbers
24 and 26 are companion numbers
Yes. I use column D because it is the first column for formula in post#4, might change to column C.Therefore, can we have a formula that:
1. Do not always make reference to Column D
(Since the companion numbers come in pairs, can the formula reference to only its own column and that of the companion number, rather than always Column D)
We can use 50 rows above current row or maybe less eg C670:C720.2. Preferrably trace from bottom up rather than from the first row (because in reality there are thousands of readings continuously updated)
I apologise.
I was initially setting out the basic scenario because in reality the number groups combination have several variants, so setting all those out will become overly complicated.
To answer your question:
1) Most of the number groups have either 2 or 4 numbers, however we are only comparing 2 directly related companion numbers, which as you describe compare column D with E and Column C with F. Only that at this stage, not other columns within the same number group.
2) In reality, the companion numbers for some number groups are up to 5 to 7 columns apart, with interspersed numbers from other groups in-between. In a few cases, the number of columns apart between companion numbers could be more. However, if the formula reference to only its own column and that of the companion number, possibly I could adapt the formula to accommodate those situations.
If you are kind enough, would it be possible to cater for scenario 1 for now (which is set out in my spreadsheet in post #5), and I see whether can adapt the formula to the other scenario.
Many thanks!
Please try at C722
Formula:Please Login or Register to view this content.
=(OFFSET(C671:C720,,-(MOD(COLUMNS($C1:C1)-1,4)-1.5)*2)
This is use for find companion column
=-(MOD(COLUMNS($C1:C1)-1,4)-1.5)*2 copy to the right gives 3, 1, -1, -3, 3, 1, -1, -3
=(OFFSET(C671:C720,,3) = F671:F720
=(OFFSET(D671:D720,,1) = E671:E720
=(OFFSET(E671:E720,,-1) = D671:D720
=(OFFSET(F671:F720,,-3) = C671:C720
=(OFFSET(G671:G720,,3) = J671:J720 and so on every 4 columns
Similar to =OFFSET(C721,,-MOD(COLUMNS($C1:C1)-1,4),,4))
This is used for find No. of cells lapsed since last reading of each group.
Thank you very much!
The formula for the two adjacent numbers (1,34 in Group A / 4,31 in Group B) seem to work.
I am not good enough to understand how it works but think I can hire someone to adapt the formula for other scenarios.
Very helpful
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks