age wise group data sort

majidsiddique

Board Regular
Joined
Oct 22, 2018
Messages
164
Hi all,

tell me how i can values in group wise below mention table.

PersonAge
majid19
sajid25
khalid20
ahmed60
nasir35
khan45
gulraz31

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

Age-G
majidsajidkhalidahmednasirkhangulraz
15-2919
30-44
45-60

<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>
</tbody>


for example Majid age is 45 appear in age group 45-60. i try this but failed. can anybody help me?

=IF(G$2=VLOOKUP(G$2,$A$2:$A$8,1,0),IF(AND($B2>=15,$B2<=29),$B2,"--"))
this formula never complete solution when trag it in column wise, fail.

trag it all 19 value paste in column wise.

thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Assuming your Person / Age table is A1:B8 and the table you want to fill in is A10:H13 then this formula in B11 and dragged should work for you;

Code:
=IF(AND(VLOOKUP(B$10,$A$2:$B$8,2,FALSE)>=VALUE(LEFT($A11,2)),VLOOKUP(B$10,$A$2:$B$8,2,FALSE)<=VALUE(RIGHT($A11,2))),VLOOKUP(B$10,$A$2:$B$8,2,FALSE),"")
 
Upvote 0
If your lookup table is in A2:B8 and the Age Group table in A13:H16 you can try something like:

=IF(AND(VLOOKUP(B$13,$A$2:$B$8,2,0)>=--LEFT($A14,2),VLOOKUP(B$13,$A$2:$B$8,2,0)<=--RIGHT($A14,2)),VLOOKUP(B$13,$A$2:$B$8,2,0),"")

This should work as long as both the min and max of each age group have 2 digits (= between 10 and 99). Otherwise you should replace the fixed length of two characters with a SEARCH of FIND function that locates the "-" from your age groups. Or if you want to get away real easy try having both max and min values of each age groups in helper columns ( = No need for double negatives or any other extra calculations).
 
Upvote 0

Forum statistics

Threads
1,215,577
Messages
6,125,637
Members
449,242
Latest member
Mari_mariou

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