Find last row number or the group after condition is applied.

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,373
Office Version
  1. 2010
Hello,

I have 1 to 5 groups in the column "C" and in the cells E6:E10 unique groups numbers array formula is entered in the cells
VBA Code:
F6:F10 =IF(MAX((E6=$C$1:$C$52)*(ROW($C$1:$C$52)))=0,,MAX((E6=$C$1:$C$52)*(ROW($C$1:$C$52))))
and it is conformed by CTRL + SHIFT + ENTER.
So I get the last row number each of the group as shown result in the cells F6:F10 this works perfect.

Now what I need I have same 1 to 5 groups in the column "M" and unique group numbers in the cells O6:O10 "but I want apply the condition in the Column "K" by placing "1" in it so to check only the groups 3, 4 and 5 last row number. As this result would be different than previous as shown in the cells P6:P10...please suggest the new formula for this conditional grouping to find last row number in cells P6:P10.

*ABCDEFGHIJKLMNOPQ
1
2
3ConditionConditional
4GroupGroupFindTo CheckGroupGroupFind
5GroupGroupLast RowLast RowGroupGroupLast Row
65123510
74230420
843534348
944514449
1055475546
1133
1244
1355
14414
1544
1644
1755
1844
19414
2044
2144
2211
2333
2455
2544
2633
2744
2855
2922
3044
3155
3244
3333
34515
3533
3644
3755
3844
3955
40515
4144
42414
43414
4455
4533
46515
47414
48313
49414
5044
5133
5233
53
54
55

For a more detail the image is attached. Pease suggest new conditional formula


Thank you all.

I am using Excel 2000

Regards,
Moti
 

Attachments

  • Conditional RowNumber.png
    Conditional RowNumber.png
    44.7 KB · Views: 6

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How about
Excel Formula:
=IF(ISNA(LOOKUP(2,1/($M$6:$M$52=O6)/($K$6:$K$52=1),ROW($M$6:$M$52))),0,LOOKUP(2,1/($M$6:$M$52=O6)/($K$6:$K$52=1),ROW($M$6:$M$52)))
 
Upvote 0
Solution
How about
Excel Formula:
=IF(ISNA(LOOKUP(2,1/($M$6:$M$52=O6)/($K$6:$K$52=1),ROW($M$6:$M$52))),0,LOOKUP(2,1/($M$6:$M$52=O6)/($K$6:$K$52=1),ROW($M$6:$M$52)))
Fluff, I cannot even imagine that the formula could be written without array this is really amazing it worked magical and result are as treat. ?

This easy formula has been big help for my necessity. I do appreciate your great assist and thank you for the time you spent to solve this in a simple way.

Kind Regards,
Moti :)
 
Upvote 0
You could also use this instead of you original formula in F6
Excel Formula:
=IF(ISNA(LOOKUP(2,1/($C$6:$C$52=E6),ROW($C$6:$C$52))),,LOOKUP(2,1/($C$6:$C$52=E6),ROW($C$6:$C$52)))
 
Upvote 0
You could also use this instead of you original formula in F6
Excel Formula:
=IF(ISNA(LOOKUP(2,1/($C$6:$C$52=E6),ROW($C$6:$C$52))),,LOOKUP(2,1/($C$6:$C$52=E6),ROW($C$6:$C$52)))
Wow Fluff, that is so nice I will replace my older formula with this your's one it is in fact very useful without the array thank you very much for letting me know otherwise I would not have it ended.

Good luck and have a joyful weekend. ?

Kind Regards,
Moti :)
 
Upvote 0

Forum statistics

Threads
1,216,127
Messages
6,129,024
Members
449,482
Latest member
al mugheen

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