Get last data formula from column greater is than 1

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,362
Office Version
  1. 2010
Hi everyone,</SPAN></SPAN>

In the below sheet I have formulas and data fill in cells: B2:O20 and cells B21:O21 data comes from another source.</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNO
1Game1234567891011121314
2JR181
3JR191211
4JR20312
5JR2113
6JR2221
7JR2311
8JR24112
9JR25123
10JR2634
11JR27151
12JR28612
13JR293
14JR3014
15JR3111125
16JR3212121236
17JR33
18JR34
19JR35
20JR36
21461412137998761214
Data


I need formula for in cells B22:O22 that can get last data from each column is greater than 1 as shown below</SPAN></SPAN>


Book1
ABCDEFGHIJKLMNO
1Game1234567891011121314
2JR181
3JR191211
4JR20312
5JR2113
6JR2221
7JR2311
8JR24112
9JR25123
10JR2634
11JR27151
12JR28612
13JR293
14JR3014
15JR3111125
16JR3212121236
17JR33
18JR34
19JR35
20JR36
21461412137998761214
2222236
Data Result


Thanks And Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
 
Hi Aladin Akyurek,

Enter markmzz’s formula shown below in the cell B22 and copy across O22

Code:
=IF(INDEX(B$2:B$20,MAX(INDEX(($B$2:$O$20<>"")*(ROW($B$2:$B$20)-ROW($B$2)+1),)))>1,INDEX(B$2:B$20,MAX(INDEX(($B$2:$O$20<>"")*(ROW($B$2:$B$20)-ROW($B$2)+1),))),"")


1-Now enter your 1st formula shown below in cell A24, control+shift+enter, not just enter
Code:
=MAX(IF(ISNUMBER(B2:O20),ROW(B2:O20)))

2-Now enter your 2nd formula shown below in cell B24 and copy across O24
Code:
=IF(COUNTIF(B2:INDEX(B:B,$A$24),">1"),  IF(LOOKUP(9.99999999999999E+307,B2:INDEX(B:B,$A$24))>1,  LOOKUP(9.99999999999999E+307,B2:INDEX(B:B,$A$24)),""),"")

Please take a look sheet shown below your formula track in the Cell N24 number 3 which is not find in the row 16

ABCDEFGHIJKLMNO
1Game1234567891011121314
2JR181
3JR191211
4JR20312
5JR2113
6JR2221
7JR2311
8JR24112
9JR25123
10JR2634
11JR27151
12JR28612
13JR293
14JR3014
15JR3111125
16JR3212121236
17JR33
18JR34
19JR35
20JR36
21461412137998761214
22Resulta22236
23
2416222336

<tbody>
</tbody>
Data



Now for example insert any number in the row 17 cells B17 O17 (I have insert 4 in L17) and see the result below markmzz’s formula result show only number 4
But your formula result shows all and change 3 to 4 in cell L24

ABCDEFGHIJKLMNO
1Game1234567891011121314
2JR181
3JR191211
4JR20312
5JR2113
6JR2221
7JR2311
8JR24112
9JR25123
10JR2634
11JR27151
12JR28612
13JR293
14JR3014
15JR3111125
16JR3212121236
17JR334
18JR34
19JR35
20JR36
21461412137998761214
22Resulta4
23
2417222436

<tbody>
</tbody>
Data



So far I find markmzz’s formula is giving correct result for my need


I appreciate you help for looking my request to solve it, and also hope now I have explained my require correctly


Regards,
Moti

That's the exactly the problem that you have: What row must be considered as the last row for evaluation? Delete for example some initial values from row 16. Do you still have the correct results?
 
Last edited:
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
What row must be considered as the last row for evaluation?

Hi Aladin Akyurek</SPAN></SPAN>

The evaluation row? Must be considered the last row in which data are found </SPAN></SPAN>
In the example above last evaluation row will be considered 17 because 4 is find in that row. </SPAN></SPAN>

Delete for example some initial values from row 16. Do you still have the correct results?

No, Did you try markmzz’s formula?


Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
 
Upvote 0
Hi Aladin Akyurek

The evaluation row? Must be considered the last row in which data are found
In the example above last evaluation row will be considered 17 because 4 is find in that row.



No, Did you try markmzz’s formula?


Regards,
Moti

I think we have a communication problem here... The formula in A22 I posted looks for the highest row number and the fromula in B22 copied across takes up the A22 result as the row to evalutate. If that's all wrong, I have nothing to add...
 
Upvote 0
I think we have a communication problem here... The formula in A22 I posted looks for the highest row number and the fromula in B22 copied across takes up the A22 result as the row to evalutate. If that's all wrong, I have nothing to add...

Hi Aladin Akyurek, </SPAN></SPAN>

I think You are very right I got correct result with your formulas as per my opening post. </SPAN></SPAN>

But after I found another problem when I checked with my original data. And start confusion. </SPAN></SPAN>

I am so sorry about that</SPAN></SPAN>

Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
 
Upvote 0
Hi Aladin Akyurek,

I think You are very right I got correct result with your formulas as per my opening post.

But after I found another problem when I checked with my original data. And start confusion.

I am so sorry about that

Regards,
Moti

No problem. If you sorted it out, I'm happy with that.
 
Upvote 0
Code:
In B22

=IF(INDEX(B$2:B$20,MAX(INDEX(($B$2:$O$20<>"")*(ROW($B$2:$B$20)-ROW($B$2)+1),)))>1,
INDEX(B$2:B$20,MAX(INDEX(($B$2:$O$20<>"")*(ROW($B$2:$B$20)-ROW($B$2)+1),))),"")

And copy to the right.

Thank you markmzz, for your kind support your above formula is working like a magic It is giving 100% perfect result of the last entered values when it is grater than 1

I appreciate your help and time

Regards,
Moti

Hi Moti,

I'm glad to help and thank you for the feedback.

Markmzz
 
Upvote 0
Hi motilulla,

A little shorter solution I propose :)
in A24 Aladin's formula for MAX row

For B24

=IF(INDIRECT(ADDRESS($A$24,COLUMN()))>1,INDIRECT(ADDRESS($A$24,COLUMN())),"")

and copy right

Greetings :))
 
Upvote 0
Hi motilulla,

A little shorter solution I propose :)
in A24 Aladin's formula for MAX row

For B24

=IF(INDIRECT(ADDRESS($A$24,COLUMN()))>1,INDIRECT(ADDRESS($A$24,COLUMN())),"")

and copy right

Greetings :))

That would not be very efficient for it contains too many volatile functions.

Once we have the MAX row in A22 (or A24 for that matter) and that row must be checked for entries > 1, the following is cheaper:

B22, copied across:

=IF(INDEX(B:B,$A$22)>1,INDEX(B:B,$A$22),"")
 
Upvote 0
Hi Aladin,

I absolutely agree with you. It was only my first (and fast) impresion of this topic.
Your formula is much better :))
Greetings.
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,826
Members
449,190
Latest member
rscraig11

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