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:
person Aperson Bperson C
date1equity1equity2equity3
date2equity4equity5equity6
date3equity7equity8equity9

<tbody>
</tbody>

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.
 

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,830
Office Version
  1. 365
Platform
  1. Windows
Why not use a 'composite' key by combining the data and the name?
 
Last edited:

Elainaz

New Member
Joined
Apr 8, 2019
Messages
6
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?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,830
Office Version
  1. 365
Platform
  1. Windows
Yes, that's basically what I mean.
 

Kyle123

Well-known Member
Joined
Jan 24, 2012
Messages
2,708
Or nested dictionaries, a top level with unique dates and then one with names (or vice versa)
 

Watch MrExcel Video

Forum statistics

Threads
1,108,858
Messages
5,525,236
Members
409,637
Latest member
LT TASL

This Week's Hot Topics

Top