Need to multiply and add if numbers exist.

SheilaWillis71

New Member
Joined
Oct 10, 2011
Messages
6
Hi there, long time no post, need some help please. My table looks something like:

A B C D E
1 Hourly Rate Hours Daily Rate Days Total
2 NA 300 1

So what I want to say is: If you see numbers, then work with them, if not a number - skip it. Kind of like:
=Cell A2 x B2 + C2 x D2. However, this does not work because A2 says NA and B2 is blank, so I get #N/A.

Which is the same as:
Hourly rate x hours + daily rate x days = total

In this case, there is no hourly rate and therefore NA (not #N/A) is in the cell and the Hours cell is blank, but there is a daily rate and we used the item for only 1 day.

Thanks much
Sheila


<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi Sheila,

You can use this:
Code:
=(SUM(A2)*SUM(B2))+(SUM(C2)*SUM(D2))
 
Upvote 0
Welcome back!

Not sure if it would ever be possible to have numbers in both sections, or what result you want if that does happen, but this may also work for you.

Excel Workbook
ABCDE
1Hourly RateHoursDaily RateDaysTotal
2NA3001300
340835335
40
5408320
62903870
7358.5NA297.5
8NANA0
Ignore text values
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,776
Messages
6,126,830
Members
449,343
Latest member
DEWS2031

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?

Disable AdBlock

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
Back
Top