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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How about
Excel Formula:
=IFERROR(AVERAGEIF($B8:C8,"<>No data"),"No Data")
 
Upvote 0
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
 
Upvote 0
Ok, how about
Excel Formula:
=SUM($B8:C8)/(COUNTIFS($B6:C6,">0"))
 
Upvote 0
Solution
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"
 
Upvote 0
Just wrap my formula in an iferror.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,596
Messages
6,120,438
Members
448,966
Latest member
DannyC96

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