# SUM based on values in four cells

#### pjzimm

##### New Member
I've searched in vain with no luck. Please point me to a similar post or give me some advice on this *easy* formula.

I need H60 = D40 if there are no values in D41, D42, or D43.
I need H60 = D41 if there are no values in D40, D42, or D43.
I need H60 = D42 if there are no values in D40, D41, or D43.
I need H60 = D43 if there are no values in D40, D41, or D42.

What is the formula? Thank you in advance!

### Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

#### texasalynn

##### Well-known Member
Welcome to the Board!

Try this
Code:
``=IF(AND(D41="",D42="",D43=""),D40,IF(AND(D40="",D42="",D43=""),D41,IF(AND(D40="",D41="",D43=""),D42,IF(AND(D40="",D41="",D42=""),D43,0))))``

HTH

#### pjzimm

##### New Member
It works! Thank you very much!

Replies
4
Views
306
Replies
0
Views
876
Replies
14
Views
588
Replies
5
Views
484
Replies
4
Views
260

1,191,420
Messages
5,986,464
Members
440,031
Latest member
davidvillegasr

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

### Which adblocker are you using?

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

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