# formula code help

#### vbidiot

##### New Member
Hey All,

I'm looking to write a code for the below spreadsheet. I need for the sum of RG, SL, PL hours to equal the WD hours for each individual. For example, if Janey Doooe has 32 RG hours, 4 SL hours, 4 PL hours then the WD hours need to equal 40 hours. Also, if the person does not have any RG hours, SL hours, or PL hours then HW and WD hours need to be deleted. I've wrestled with this many different ways but can't quite come out with a simple code for it. Here's a bit of sample from the spreadsheet.

NAME WC PUNIT PRATE
Doooe, Janey HW 1.00 -\$7.60
Doooe, Janey RG 32.00 11.83
Doooe, Janey SL 4.00 11.83
Doooe, Janey PL 4.00 11.83
Doooe, Janey WD 0.00 \$2.87
Dossss, Jake HW 1.00 -\$10.78
Dossss, Jake RG 40.00 \$12.56
Dossss, Jake WD 0.00 \$2.87

Thanks!!!!

### Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

#### vbidiot

##### New Member
"at each change in name" factor

Is it possible to use "at each change in name" to help with the coding?

Ex. At each change in name, total RG, SL, PL hours and then enter toal amount in WD hours field.

EX. at each change in name, if name does not have RG, SL, or PL hours then delete HW, WD hours.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,126
Messages
5,857,523
Members
431,883
Latest member
Hien

### 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?

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