Xen
Member
Hello,
I'm stuck with a problem where I have multiple tables following one pattern, which is not really suitable for analysis and further processing.
______________________________________________________
File attached should make things clear, I will try to explain it in words:
Columns represent hour when purchase was made, some stores might open/close at different times.
In rows you have 3 fields: date (only written once), then number of products sold and revenue.
Each time a new date is added, table gets 3 new rows.
______________________________________________________
First thing I need, is reformat this table and make data suitable for PivotTable, in this format (5 columns):
Store name, date, hour, sales, revenue
And this preferably should be done without use of VBA. I've solved this, but not in a very attractive way:
Pre-made a sheet for each store and with store/date/hour columns pre-filled, and each sales/revenue cell referring to specific location in table. Dates that are not yet filled have zero valies. This simplifies process a lot, yet still has much manual work to it.
I suspect that there is more elegant way to reformat table like this. I've been playing with index-match, counting ranges and such, ended up with huge formula that did not work after all.
So, can anyone tell me where should I start? Store name is easily extracted from sheet/filename, then (biggest problem) it somehow has to find how many dates are there, how many hours shop worked and fill values accordingly, then do some complex matching where it looks vertically for date, then horizontally for hour.
______________________________________________________
Now, there is second part to this problem, where I have to append data from different store into one big table.
Say, we now have 'normal' data from each store. I imagine having same formula down to the bottom of the sheet, and said formula scans each file and fills cells with it's contents, then, when there is no more rows left in current file, it starts working with new one until it runs out of file. I've encountered this problem a few times where I have to fill values until no values left in one table, then get values from other table in same fashion.
Is there a non-VBA solution for this as well?
______________________________________________________
Telling me what formulas and tricks to use and where to start should be enough.
Thanks to anyone who has any suggestions!
I'm stuck with a problem where I have multiple tables following one pattern, which is not really suitable for analysis and further processing.
File attached should make things clear, I will try to explain it in words:
Columns represent hour when purchase was made, some stores might open/close at different times.
In rows you have 3 fields: date (only written once), then number of products sold and revenue.
Each time a new date is added, table gets 3 new rows.
First thing I need, is reformat this table and make data suitable for PivotTable, in this format (5 columns):
Store name, date, hour, sales, revenue
And this preferably should be done without use of VBA. I've solved this, but not in a very attractive way:
Pre-made a sheet for each store and with store/date/hour columns pre-filled, and each sales/revenue cell referring to specific location in table. Dates that are not yet filled have zero valies. This simplifies process a lot, yet still has much manual work to it.
I suspect that there is more elegant way to reformat table like this. I've been playing with index-match, counting ranges and such, ended up with huge formula that did not work after all.
So, can anyone tell me where should I start? Store name is easily extracted from sheet/filename, then (biggest problem) it somehow has to find how many dates are there, how many hours shop worked and fill values accordingly, then do some complex matching where it looks vertically for date, then horizontally for hour.
Now, there is second part to this problem, where I have to append data from different store into one big table.
Say, we now have 'normal' data from each store. I imagine having same formula down to the bottom of the sheet, and said formula scans each file and fills cells with it's contents, then, when there is no more rows left in current file, it starts working with new one until it runs out of file. I've encountered this problem a few times where I have to fill values until no values left in one table, then get values from other table in same fashion.
Is there a non-VBA solution for this as well?
Telling me what formulas and tricks to use and where to start should be enough.
Thanks to anyone who has any suggestions!
Attachments
Last edited: