Hello,
I have around 1000 row line items and in another col I have 20 names. I want to allocate the 1000 rows equally among the 20 people using a command button.
Request your help!
Hello,
I have around 1000 row line items and in another col I have 20 names. I want to allocate the 1000 rows equally among the 20 people using a command button.
Request your help!
Last edited by naveenhs5; 11-19-2011 at 10:23 AM.
naveenhs5
Welcome to the forum
To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.
If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.
Doing this will ensure you get the result you need!
I have attached the file!
hi, naveenhs5, hope it helps, run code "test"
Last edited by watersev; 11-17-2011 at 08:54 AM.
Hi naveenhs5,
You dont need a macro
=OFFSET(F$2,IF(MOD((ROW()-1)/D$1,1)*D$1=0,D$1-1,(MOD((ROW()-1)/D$1,1)*D$1)-1),0)
to fill the column
or create a table
=IF($F2<>"",OFFSET($A$1,(ROW()-1)+($D$1*(COLUMN()-7)),0),"")
I didnt understand your use of "Rept" in the first row in the excel sheet. This will be a good learning for me. Can you please explain?
Ops it should have been
=OFFSET(F$2,IF(MOD((ROW()-1)/D$1,1)*D$1=0,D$1-1,ROUND(MOD((ROW()-1)/D$1,1)*D$1,1)-1),0)
REPT ? where
O rept
=LOOKUP(REPT("z",255),F2:F30)
Looks up the last string in a column
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
or to explain more
To get the LAST text value in a list
=LOOKUP(REPT("z",255),F2:F30)
Use of REPT function
REPT("z",255) = A string consisting of 255 "z"s and is the largest string Excel can handle.
so when lookup can find it, it defaults to the last value in list
Hi Pike,
Your formula is working fine and solved the issue....thank u very much!
Is it possible to just explain in brief how ur formula works?....just want to explore Excel.
Thanks!
which one?
this one - =OFFSET(F$2,IF(MOD((ROW()-1)/D$1,1)*D$1=0,D$1-1,ROUND(MOD((ROW()-1)/D$1,1)*D$1,1)-1),0)
hi naveenhs5
=OFFSET(F$2,IF(MOD((ROW()-1)/D$1,1)*D$1=0,D$1-1,ROUND(MOD((ROW()-1)/D$1,1)*D$1,1)-1),0)
offset(cell to offset, Rows, Columns ) and
If(Test Boolean argument, value for true, value for false)
But the interesting is
ROUND(MOD((ROW()-1)/D$1,1)*D$1
It uses the remainder of the division of a number by constant divisor times the divisor
It’s a divisor rule which I can’t remember the name of
It creates the number sequence
So basic we create a repeating set number 0-7 from any row number to offset from F2
You can see it in action if you click in the cell with formula and the good to the formula tool bar and click evaluate formula
ROUND(MOD((ROW()-1)/D$1,1)*D$1
is a Modulo operation
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks