dictionary question

Elainaz

New Member
Joined
Apr 8, 2019
Messages
6
Hi, is it possible two have two keys for each value?

Here's the problem I'm facing with. I have some balance sheets for different people with different dates in different worksheets and files. I want to extract certain data such as the numbers of equity or debt from balance sheet, and rearrange them into a time-series data in a new worksheet.

I googled some similar tasks and found the dictionary might help me with it. But I checked some dictionary sample code and found most of them are "a key for a value" patterns, which seems not applying to my problem. So I wander whether it's possible to have two keys for each value. Like, key1=date, key2=person name, and value=debt or equity.
So when I rearrange the data, I could list them like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]person A[/TD]
[TD]person B[/TD]
[TD]person C[/TD]
[/TR]
[TR]
[TD]date1[/TD]
[TD]equity1[/TD]
[TD]equity2[/TD]
[TD]equity3[/TD]
[/TR]
[TR]
[TD]date2[/TD]
[TD]equity4[/TD]
[TD]equity5[/TD]
[TD]equity6[/TD]
[/TR]
[TR]
[TD]date3[/TD]
[TD]equity7[/TD]
[TD]equity8[/TD]
[TD]equity9[/TD]
[/TR]
</tbody>[/TABLE]

If not, would you mind giving me a hint about how to deal with it? I'd really appreciate it. I just learnt vba for less than two months by myself. So sometimes I kinda fell that I'm lost and don't know where to go.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Why not use a 'composite' key by combining the data and the name?
 
Last edited:
Upvote 0
Thanks for your advice:) But I'm still a little confused.
Do you mean combine the name and date with some punctuatuion between them, and use split to process the key when making a time series table?
 
Upvote 0
Yes, that's basically what I mean.
 
Upvote 0
Or nested dictionaries, a top level with unique dates and then one with names (or vice versa)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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