Question: I am creating a game in which an object can have different conditions throughout a level. Each condition has a numeric value. In the left column I have the list of conditions such as RED, GREEN, BLUE, TAN, ORANGE. In the right column I have given each of those conditions a value of 1 through 5. 

Using this as a key, I would like to go through the game, level by level, marking down all of the conditions that object encounters per level.

For example, In level 1 the Object can be RED, BLUE, ORANGE. In an Excel row, I want to, in separate cells, mark which conditions are encountered. So B2 would be "RED", C2 would be "BLUE" and D2 would be "ORANGE". Then I want to be able to add up those cells to know what the sum of those condition values are. 

I have been able, in Name Manager, to assign values to names but I am unable to add separate cells with the condition names together. I am only able to do this as a equation inside of a single cell using "= RED + BLUE + ORANGE" However, it is then difficult, visually, to see all of the conditions for each level, it only shows the total value in the cell containing the equation. 

Thank you very much for your help. Let me know if any additional clarification is needed.

Answer: 
I tried out a sample project and it works fine for me like this

```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellIdentifier =@"CustomCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (!cell)
    {
        NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
        cell = (UITableViewCell*)[array objectAtIndex:0];
       }

    UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [button addTarget:self
               action:@selector(MoveToNextView:)
     forControlEvents:UIControlEventTouchDown];
    [button setTitle:@"Custom Action" forState:UIControlStateNormal];
    button.frame = CGRectMake(150.0f, 5.0f, 150.0f, 30.0f);
    button.tag=indexPath.row;
    [cell.contentView addSubview:button];

    return cell;
}
-(void)MoveToNextView:(id)sender
{
    UIButton *button = (UIButton *)sender;

    NSLog(@"Tag Value = %d",button.tag);
}

```

and on button click my log shows

```
2013-07-23 11:58:31.719 Trial[895:11303] Tag Value = 0
2013-07-23 11:58:33.726 Trial[895:11303] Tag Value = 1
2013-07-23 11:58:35.126 Trial[895:11303] Tag Value = 2
2013-07-23 11:58:35.998 Trial[895:11303] Tag Value = 3
2013-07-23 11:58:36.910 Trial[895:11303] Tag Value = 4

```
You have initialized a button in a wrong way

Instead your code as below,

```
 UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
           action:@selector(MoveToNextView:)
 forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Custom Action" forState:UIControlStateNormal];
button.frame = CGRectMake(150.0f, 5.0f, 150.0f, 30.0f);
button.tag=indexPath.row;
[cell.contentView addSubview:button];

```

Please try with my following code

```
 UIButton *button = [UIButton alloc]init];
 button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
           action:@selector(MoveToNextView:)
 forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Custom Action" forState:UIControlStateNormal];
button.frame = CGRectMake(150.0f, 5.0f, 150.0f, 30.0f);
button.tag=indexPath.row;
[cell.contentView addSubview:button];

```

Enjoy Programming!