I have data in excel in following format
Resource 2/2/2013 2/3/2013 2/4/2013
Name1 9 9 9
Name2 9 9 9
Name3 9 9 9
I have to convert the above data into something like this:
Resource Date Hours
Name1 2/2/2013 9
Name1 2/3/2013 9
Name1 2/4/2013 9
Name2 2/2/2013 9
Name2 2/3/2013 9
Name2 2/4/2013 9
Name3 2/2/2013 9
Name3 2/3/2013 9
Name3 2/4/2013 9
Is there any function in excel
that can do that. I could find only the row to columns
function that didn't help me as it will just transpose
the data and not create multiple entries like above.
What could be the best way to do this even through VBA
.
I was wondering if it is possible make without VBA and it seems that it is. But with some presumption, specifically that the area you are transformin is rectangular.
Then you could use QUOTIENT a MOD function (it would be possible to merge "helper columns C-E" together but for cleaner explanation I show them).
In A9 I have a value with number of columns (it could be get by another function) - just to be a bit generic.
Then I use INDIRECT() function in this manner:
=INDIRECT("R"&2+D9&"C1";FALSE)
=INDIRECT("R1C"&2+E9;FALSE)
=INDIRECT("R"&2+D9&"C"&2+E9;FALSE)
And then just drag it down.
Here is a VBA solution:
Original:
Result: