Create an average in alternating cells

99problems

New Member
Joined
Feb 5, 2021
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hey people, I need a hand here. So, I have values in cells B4 and B6. I need to be able to create an average in cell C5. Problem I’m having is, I need a formula in every C cell due to the nature of input, but I don’t need a trailing average, like I am getting right now in cell C7. Basically, once I do my input B6, I don’t need it to average that number with “0” in C7. What do I do? Thanks in advance for your help.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Welcome to the Board!

I am having a hard time visusally what you are trying to do. Can you provide a sample, along with your expected results?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Excavation Template.xlsx
ABCDEFGH
6
7STAAlignmentLengthWidthAvg. WidthDepthAvg. Depth
81+00L/LF104
950157
101+50L/LF206
1150
122+00L/LF308
1350
142+50L/LF104
1550
163+00L/LF206
1750
183+50L/LF308
1950
204+00L/LF104
21
22
23
LC#5 Unclassified Excavation
 
Upvote 0
My hopes is to have anything in column E read the average of the alternating cells of column D, but not have a result show in cell E21, as there is no second value present in D22. BUT, if the values were input a row down (in relation to the above sheet). then the results in E would also shift, without a result in E22, cause there would be no value present in D23. Not sure if that is any more clear, but I hope it helps a little.
 
Upvote 0
Still a bit confusing.
Can you walk us through the examples you posted and tell us exactly how you got that number?

At first, I though the average width in E9 was looking at the row above and below it in column E, so it is averaging D8 and D10, which would give us the 15 that we see in cell E9.

But then I looked at Depth, and the logic I assumed does not seem to hold muster there, as the average of 4 and 7 is 5, not 7.
So I guess I still do not understand the logic you want to use.

Also, are columns F and G merged cells? If so, I STRONGLY suggest getting rid of them. Merged cells are a cancer to Excel and cause ALL sorts of issues!
Better to use the "Center Across Selection" formatting option than to use Merged cells.
 
Upvote 0
Your first assumption is correct, as it turns out the sheet is not complete. Sorry about that. At the moment I am working solely on the average width area, trying to find a formula I can paste down the sheet and some other sheets. Working with only average width, the "E" cells are ONLY to read the "D" cells above and below it. I could do the simple "(D8+D10)/2", but the problem with filling that down is that when I have a break after input at "D20", the "E21" will still average with a blank cell. I want to get rid of that blank cell at the end. BUT, I can't simply skip cells, because if my next set of numbers start at row 23, the my odd and even rows will reverse, so I need formulas in every cell.
 
Upvote 0
Place this in cell E9 and copy down.
Excel Formula:
=IF(AND(D8>0,D10>0), AVERAGE(D8,D10),"")
I think this does what you are looking for.
 
Upvote 0
Solution
That is exactly it. I thought I had tried that, but I missed it by a command. Sometimes you can't see the forrest....but thank you for your help. Exactly what I needed.
 
Upvote 0
You are welcome.
Glad I was able to help.
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,603
Members
449,089
Latest member
Motoracer88

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