take and sort if

orsm6

Active Member
Joined
Oct 3, 2012
Messages
496
Office Version
  1. 365
Platform
  1. Windows
hi all - how can I expand on Fluff's formula to include to return the same ranges only if column E contains the text "shift 1"?

=TAKE(SORT(HSTACK(i43:i1501,d43:d1501),1,-1),5)

so still looks at top 5 times in column I
matches the times to the reason code in column D

but only gets the top 5 times for the text "shift 1" from column E


TIA
 
Can you post the formula you are using?...a direct copy/paste into your post.
Also, confirm the columns where BOSCH and shift 1 might appear, and the columns that should appear in the final result.
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Upvote 0
hmmm...I don't see any issues with it. A #VALUE! error? Is there anything strange in rows 43:1501...or just a table of values?

If you eliminate *(E43:E1501="shift 1") from the expression, do you get results?
If you eliminate (B43:B1501="BOSCH")* from the expression, do you get results?
Also, type Bosch somewhere on your worksheet, as I've done in B38, then enter an expression similar to that shown in B39, but reference a known "Bosch" value in column B and see if the result is TRUE.
MrExcel_20240131_C (version 1).xlsx
B
38Bosch
39TRUE
40
41
42
43BOSCH
Sheet4
Cell Formulas
RangeFormula
B39B39=B38=B43
 
Upvote 0
hmmm...I don't see any issues with it. A #VALUE! error? Is there anything strange in rows 43:1501...or just a table of values?

If you eliminate *(E43:E1501="shift 1") from the expression, do you get results?
If you eliminate (B43:B1501="BOSCH")* from the expression, do you get results?
Also, type Bosch somewhere on your worksheet, as I've done in B38, then enter an expression similar to that shown in B39, but reference a known "Bosch" value in column B and see if the result is TRUE.
MrExcel_20240131_C (version 1).xlsx
B
38Bosch
39TRUE
40
41
42
43BOSCH
Sheet4
Cell Formulas
RangeFormula
B39B39=B38=B43
I get values when i remove Bosch

as mentioned, the column where it finds bosch has a formula that is returning the word bosch. i think i can work around this though with another column.
 
Upvote 0
hmmm...I don't see any issues with it. A #VALUE! error? Is there anything strange in rows 43:1501...or just a table of values?

If you eliminate *(E43:E1501="shift 1") from the expression, do you get results?
If you eliminate (B43:B1501="BOSCH")* from the expression, do you get results?
Also, type Bosch somewhere on your worksheet, as I've done in B38, then enter an expression similar to that shown in B39, but reference a known "Bosch" value in column B and see if the result is TRUE.
MrExcel_20240131_C (version 1).xlsx
B
38Bosch
39TRUE
40
41
42
43BOSCH
Sheet4
Cell Formulas
RangeFormula
B39B39=B38=B43

thanks heaps for your help. I moved the range from B to C where it holds the name Bosch Filler.... this will work fine for me :)
 
Upvote 0
It should not matter if the word Bosch is being delivered by a formula, but the formula may be delivering something other than just b-o-s-c-h. There may be a space or other character. That's why I was interesting in seeing a logical test. Physically type bosch in a cell, and then perform an equality test where you see if the just-typed bosch equals the formula-delivered bosch.
 
Upvote 0
It should not matter if the word Bosch is being delivered by a formula, but the formula may be delivering something other than just b-o-s-c-h. There may be a space or other character. That's why I was interesting in seeing a logical test. Physically type bosch in a cell, and then perform an equality test where you see if the just-typed bosch equals the formula-delivered bosch.
i did copy the word and paste it as a value to check for a space, there wasn't. but will look again
 
Upvote 0
It should not matter if the word Bosch is being delivered by a formula, but the formula may be delivering something other than just b-o-s-c-h. There may be a space or other character. That's why I was interesting in seeing a logical test. Physically type bosch in a cell, and then perform an equality test where you see if the just-typed bosch equals the formula-delivered bosch.
sorry i aslo physically typed BOSCH into a cell in column B against shift 1 - still not working.
 
Upvote 0
Okay…and the other test mentioned in post 13… if you type bosch into some other cell that is not part of the B range in the formula (let’s say that happens to be cell C30)…if you then find an empty cell and enter the formula =C30=Bxx, where Bxx represents the cell address a formula-delivered “bosch”, what do you get as a result?,,,True or False?
 
Upvote 0
Okay…and the other test mentioned in post 13… if you type bosch into some other cell that is not part of the B range in the formula (let’s say that happens to be cell C30)…if you then find an empty cell and enter the formula =C30=Bxx, where Bxx represents the cell address a formula-delivered “bosch”, what do you get as a result?,,,True or False?

here are the two variations of the formula used:

=TAKE(SORT(FILTER(HSTACK(I43:I1501,D43:D1501),(B43:B1501="Bosch")*(E43:E1501="shift 1")),1,-1),5) hard-coded the word "Bosch" = resulted in #VALUE!
=TAKE(SORT(FILTER(HSTACK(I43:I1501,D43:D1501),(B43:B1501=N42)*(E43:E1501="shift 1")),1,-1),5): where the word Bosch is picked up from cell reference = resulted in #VALUE!

refer to snip: hardcoded.png

further, i noticed that when i deleted the word BOSCH from the formula the range box for col E (shift name) disappeared... not sure what is up with that. see snip huh.png
 

Attachments

  • hard coded.png
    hard coded.png
    12.9 KB · Views: 3
  • huh.png
    huh.png
    30.8 KB · Views: 4
Upvote 0

Forum statistics

Threads
1,215,135
Messages
6,123,239
Members
449,093
Latest member
Vincent Khandagale

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