Register

## When do I use SUM vs LOOKUP?

Previous Contributor

## When do I use SUM vs LOOKUP?

Determining whether to use SUM or LOOKUP depends on how the mapping table is set up between the Source List (where the original data resides) and the Target List (where the formula pulling the data resides). A mapping table between the Source List and Target List can be set up in one of two places: (1) in a Module, using a List-formatted Line Item or (2) in a List on the Settings tab, using a List-formatted Property. GENERAL RULE: If your mapping table contains the Target List and maps to a Source List-formatted Line Item or List-formatted Property, then use LOOKUP in your formula. Setting your mapping table up this way says that each Target Item can map to one and only one Source List Item in the mapping table, so we are looking up that Source Item value. This is similar to VLOOKUP or HLOOKUP in Excel.If your mapping table contains the Source List and maps to a Target List-formatted Line Item or List-formatted Property, then use SUM in your formula. Setting your mapping table up this way says that each Target Item can map to many Source Items, so we are summing up all Source data that is to land in each Target List Item. This is similar to SUMIF in Excel. GENERAL QUESTIONS TO ASK YOURSELF when determining whether to use SUM or LOOKUP: What is my Target List, where I want to write the formula and summarize or break out the data?What is my Source List, where the data currently is?How am I mapping/connecting my Target and Source Lists? What is the structure of this mapping table?Once you have an answer for question #3, then refer back to the general rule above. Note/Hint: The formula should link the Line Item or Property that contains the Source data, and then SUM or LOOKUP the List-formatted Line Item or List-formatted Property from your mapping table. Here is an example just to show the syntax: =Transactions.Sales[SUM: Transactions.Where] In Anaplan terms: =Module.Line Item[SUM: Module.List-formatted Line Item]

3 REPLIES 3

## RE: When do I use SUM vs LOOKUP?

Great insight John, thanks for sharing!
Previous Contributor

## RE: When do I use SUM vs LOOKUP?

Hi John,  Thanks a lot for the detailed explanation!
Occasional Contributor

## Re: When do I use SUM vs LOOKUP?

Hello,

If you would like a step by step explanation for deciding between Sum vs Lookup vs Select you can view this video: