Formula to add values from two columns ingoring one if the other has an amount in it?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,210
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

I Have two ranges

D20:D250 & F20:F250

I need a total these with this rule

Not all cells have a value,
Column D needs to be ignored if column F has an amount
example

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Column D[/TD]
[TD]Column F[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]34[/TD]
[TD]43[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]66[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]35[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]The blue ones would be the ones I want to add up[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Excel Workbook
DE
15
26
33443
412
5
61766
712
812
915
106
1135
12444
134
145
155
166
1786
18111171
Sheet1
 
Upvote 0
Hi Everyone,
Maybe I didn't make it clear I only want 1 total.
So if E has no value use D if it does use E
 
Upvote 0
That is what my suggestion does!

Code:
[TABLE="width: 261"]
<tbody>[TR]
[TD="class: xl64, width: 87, align: right"]5[/TD]
[TD="class: xl64, width: 87"][/TD]
[TD="class: xl64, width: 87"][/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]6[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]34[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl64, align: right"]43[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]12[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]17[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl64, align: right"]66[/TD]
[/TR]
[TR]
[TD="class: xl64"][/TD]
[TD="class: xl64"][/TD]
[TD="class: xl64, align: right"]12[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]12[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl64"][/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]15[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl64"][/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]6[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl64"][/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]35[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]4[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl64, align: right"]44[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]4[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl64"][/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]5[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl64"][/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]5[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl64"][/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]6[/TD]
[TD="class: xl64"][/TD]
[TD="class: xl63"][/TD]
[/TR]
[TR]
[TD="class: xl63, align: right"]8[/TD]
[TD="class: xl63"][/TD]
[TD="class: xl64, align: right"]6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="class: xl65, align: right"]282[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
Hi Gaz Chops,
Sorry my mistake, I changed the ranges slightly and get y formula wrong :-(
Yours worked perfect.
Thank you very much for your help
Tony
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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