# How to check if every cell in a specified range contains a value and if its true go two rows to the right and add the value to a sum?

I have a lifting spreadsheet. In the spreadsheet, I track sets, and I also have a keycode system to track the muscle group that was used in each exercise. For each exercise I put down the keycode for the muscle groups hit in the exercise, and I want to have a separate sheet that checks the keycodes ranges, and if there is for example 'C' for chest, then it will navigate two columns to the left and add the amount of sets to the sum of chest sets in the other sheet. How can I do this? Another example could be that if the keycode is 'CF' then it would navigate two columns to the left and add the amount of sets to the sum of both chest and front delts in the other sheet. Here is the main exercise sheet (and below that is the counter sheet).

(The '#' columns signify the keycode columns)

Here is the counter sheet just to show my idea

• Hi and welcome to WebApps. If I understand you correctly, you want to enter, say, "C" in E5, and lookup a table for the value of "C", and insert the result in Cell C5. What have you tried already? Are you familiar with the function `VLOOKUP`? Jan 8 at 2:13
• @Tedinoz Im confused. So the process would be that in the case of the 'C' in E5, after detecting a C (for chest) in E5, I would want to then add the value which is in C5 (3) to the Chest sets shown in the second picture. However, this search and add case would be done for every exercise in my sheet, thus perfectly summing up the total sets that each muscle is used in throughout the entire week shown in the first picture. Jan 8 at 7:13
• @Tedinoz I also forgot to say, thank you for welcoming me :) Jan 8 at 8:23
• Okey doke. Just to be clear, this is a two step process. First you need to update the 5 "groups" (Upper 1, Lower 1, etc) - so let's say you use `VLOOKUP` for that. Ok, so with that done, now you want to populate the weekly analysis by, say, adding the number of sets for value = "C" from each of the "groups" for that week? Jan 8 at 11:19
• Are you familiar with the `SUMIF` function? Forget for a moment that you need to sum the figures from 5 groups, have you tried `SUMIF` to return the totals for just one group? Jan 8 at 11:33