=small

JOEE1979

Active Member
Joined
Dec 18, 2022
Messages
250
Office Version
  1. 365
Platform
  1. Windows
Hello,
I'm having an issue with a formula that I found on the MS page but I'm trying to change it
The formula is in cell "C2"
The original formula was =SMALL(array,COUNTIF(array,">"&K)+1)
I want to change "1" to cell "D2"
The reason is so the formula can start to count from where ever I tell it to start.
cell "D2" is a variable that I manually input

Thank you

Book1
BCD
110:00:00 AM10
2#NUM!4:00:00 AM
311:00:00 AM
422:00:00 AM
533:00:00 AM
644:00:00 AM
755:00:00 AM
866:00:00 AM
977:00:00 AM
1088:00:00 AM
1199:00:00 AM
121010:00:00 AM
131111:00:00 AM
141212:00:00 PM
15131:00:00 PM
16142:00:00 PM
17153:00:00 PM
18164:00:00 PM
19175:00:00 PM
Sheet1
Cell Formulas
RangeFormula
C1C1=SMALL(C3:C19,D1)
C2C2=SMALL(C3:C19,COUNTIF(C3:C19,">"&D1)+D2)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
what is the value in cell D1 supposed to be? If you want it to be Ten Minutes, you need to recalculate it. As the value is 10 days (Jan 10, 1900). So your comparison of C3:C19,">"&D1 is comparing time values in day one with day 10.

Or, if D1 is the [k] for the small function, why are you adding D2 (hours) to it in C2?
 
Last edited:
Upvote 0
what is the value in cell D1 supposed to be? If you want it to be Ten Minutes, you need to recalculate it. As the value is 10 days (Jan 10, 1900). So your comparison of C3:C19,">"&D1 is comparing time values in day one with day 10.

Or, if D1 is the [k] for the small function, why are you adding D2 (hours) to it in C2?
"D1" is the number of workers I have that day.
"D2" is the time I need the workers to go on shift that day.
Each worker works for 1 hour
So I need "C2" to tell me the time I have workers until.

To go back to the example I gave in post 1, the shift that day starts at 4AM, I have 10 workers, I'm good until 1PM

"D1" and "D2" are variables and change every day

Hope that helps

Thanks
 
Upvote 0
Yes, it explains the requirements better. Although I don't know why you are putting the time component variable into your [k] value of the small operation.
 
Upvote 0
Yes, it explains the requirements better. Although I don't know why you are putting the time component variable into your [k] value of the small operation.
thats where my excel knowledge is limited, and I need help pleaase
 
Upvote 0
I don't think you need to do the count function at all. If you convert your start time to a decimal (in this case 4:00 am) and add your number of employees you get the nth smallest hour you seek. I think. 4:00 am * 24 = 4, add 10 to that and you get the 14th as smallest.

Excel Formula:
=SMALL(C3:C19,D2*24 +10)
=SMALL(C3:C19,D2*24 +D1)
 
Upvote 0
I don't think you need to do the count function at all. If you convert your start time to a decimal (in this case 4:00 am) and add your number of employees you get the nth smallest hour you seek. I think. 4:00 am * 24 = 4, add 10 to that and you get the 14th as smallest.

Excel Formula:
=SMALL(C3:C19,D2*24 +10)
=SMALL(C3:C19,D2*24 +D1)
you should press F4 on D2 and D1 in the formulas to make the references absolute, and possibly for C3:C19 as well (if you drag/copy the formula).
 
Upvote 0
Book1
BCDE
110:00:00Employees for the day:10
214:00:00Start of Day:04:00:00
31Jan 1900 01 00 01 00
42Jan 1900 01 00 02 00
53Jan 1900 01 00 03 00
64Jan 1900 01 00 04 00
75Jan 1900 01 00 05 00
86Jan 1900 01 00 06 00
97Jan 1900 01 00 07 00
108Jan 1900 01 00 08 00
119Jan 1900 01 00 09 00
1210Jan 1900 01 00 10 00
1311Jan 1900 01 00 11 00
1412Jan 1900 01 00 12 00
1513Jan 1900 01 00 13 00
1614Jan 1900 01 00 14 00
1715Jan 1900 01 00 15 00
1816Jan 1900 01 00 16 00
1917Jan 1900 01 00 17 00
Sheet5
Cell Formulas
RangeFormula
C1C1=SMALL(C3:C19,10)
C2C2=SMALL(C3:C19,$E$2*24 +$E$1)
 
Upvote 0
IT worked for a single column, but when I changed the sheet to make it 6 locations, it stopped working

Book1
CDEFGHI
1Employees10
24:15:00 AMStart4:00:00 AM
3Location 1Location 2Location 3Location 4Location 5Location 6
41.01:00:00 AM7:45:00 AM1:45:00 AM1:15:00 AM1:30:00 AM8:15:00 AM
52.02:00:00 AM8:45:00 AM2:45:00 AM2:15:00 AM2:30:00 AM
63.09:45:00 AM3:30:00 AM2:00:00 PM
74.03:45:00 AM11:00:00 AM4:30:00 AM3:00:00 PM
85.04:45:00 AM5:15:00 AM5:30:00 AM4:00:00 PM
96.05:45:00 AM12:45:00 PM6:45:00 AM6:15:00 AM6:30:00 AM
107.07:30:00 AM1:00:00 PM3:45:00 PM
118.08:00:00 AM8:30:00 AM4:45:00 PM3:15:00 AM
129.09:00:00 AM4:15:00 AM
1310.010:00:00 AM10:30:00 AM3:00:00 AM
1411.05:00:00 PM11:15:00 AM4:00:00 AM
1512.012:00:00 PM9:30:00 AM12:15:00 PM5:00:00 AM11:30:00 AM
1613.07:15:00 AM1:45:00 PM1:15:00 PM6:00:00 AM12:30:00 PM
1714.02:30:00 PM2:45:00 PM2:15:00 PM7:00:00 AM1:30:00 PM
1815.09:15:00 AM3:30:00 PM3:15:00 PM
Sheet1
Cell Formulas
RangeFormula
D2D2=SMALL(D4:I18,$F$2*24 +$F$1)
 
Upvote 0
if you need this per location then you need to build it one column at a time and not on the entire matrix.
=SMALL(D$4:D$18, $F$2*24 + $F$1) and drag the formula across.

if that doesn't work, please mock up an example of what you want to see (just one or two columns).

if you need the calculation to work for the entire matrix, please tell what is wrong with the calculation?
(it may be wrong because a blank gets resolved to 0 which would be part of the small counts. if this is the case it is VERY important you give a complete description of what the matrix looks like and some examples of expected results.
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,877
Members
449,056
Latest member
ruhulaminappu

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