Maybe a loop?

Tucker92

Board Regular
Joined
Jun 7, 2018
Messages
53
Hi everyone,

I was wondering if there was a way that i would be able to add up some numbers based on whether or not there was a letter in the cell below the cell i want to include.

Currently i have a range of numbers but i need to be able to mark them in some way if they are above or below the average, this will be done manually and i was after a loop or something to go through my data and each time it finds a character record the number above and total them together into a cell i choose.

Is this possible?
Bit of a noob when it comes to VBA
 
Last edited:

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi there. Rather than manually marking up above or below the average, you could do it all in one formula. Put this formula in the cell where you want the above average sum: =SUMIF(A1:H1,">"&AVERAGE(A1:H1))

A1:H1 is the range of values, so adjust to suit. To get below average, use =SUMIF(A1:H1,"<"&AVERAGE(A1:H1)), you may want to put an equals sign in as well (i.e. >= or <=) to catch any exact matches.
 
Upvote 0
Im happy with the manual input as the numbers are timings and its just going to be the ones that are really far out. I have a timer on a userform that is used as a stopwatch and it will only be when there is an issue in the work area that the number will be far out and will easily be noticed.

I am just after a way of totaling up the marked items to be inputted into the another cell as i need an overall ineffective time of the bad ones

I can use this in another of my spreadsheets and will help alot
thank you
 
Last edited:
Upvote 0
OK thats fine. In that case, you need this formula in your desired result cell: =SUMIF(A2:H2,"n",A1:H1)
This sums all the numbers in range A1:H1 if the equivalent value in range A2:H2 (i.e. the row underneath) is an n.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,118
Members
453,021
Latest member
Justyna P

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