Formula help please (If, And, Count?)

TiNC701

New Member
Joined
May 10, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi, I have been trying to create a formula for R9 of the attached. I require it to add the cells in R8 (positive & Negative) but only upto and including that month, ignoring ones with "No data" then count how many columns had deliveries R6 again only upto and including that month. Then divide the sum of R8 by number of months with deliveries. For example
K9 will =(C8+D8+E8+F8+G8+H8+I8+J8)/7
But E9 = (C8+D8+E8)/3
If no deliveries then say "No data" like A9
I hope this makes sense, I have tried so many variations and just cannot get this to automate


Screenshot_20201207-131603_Office.jpg
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,863
Office Version
  1. 365
Platform
  1. Windows
How about
Excel Formula:
=IFERROR(AVERAGEIF($B8:C8,"<>No data"),"No Data")
 

TiNC701

New Member
Joined
May 10, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Thank you, unfortunately it doesn't quite work. When it gets to Column J it is dividing by 8 rather than the 7 months where deliveries were actually received. I need it to not count a cell in R6 if it is zero
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,863
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Ok, how about
Excel Formula:
=SUM($B8:C8)/(COUNTIFS($B6:C6,">0"))
 
Solution

TiNC701

New Member
Joined
May 10, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Sorry isn't this the same as your first suggestion?
Ok, how about
Excel Formula:
=SUM($B8:C8)/(COUNTIFS($B6:C6,">0"))
That calculation works better thank you. Can it be combined with the IFError so if I have the first 3 months with No Data it says "No data"? I tried this IFERROR(SUM($B8:C8,"<>NO data")/(COUNTIFS($B6:C6,">0")),"No data) but that doesn't seem to work, as soon as I get to the first month with data it still inserts "No data"
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,863
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

Just wrap my formula in an iferror.
 

TiNC701

New Member
Joined
May 10, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Perfect thank you so much for your help
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,863
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,146
Messages
5,640,392
Members
417,140
Latest member
whiteprose

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
Top