Formula

limo2088

Board Regular
Joined
Feb 10, 2006
Messages
53
Office Version
  1. 2019
Is there a way or is there a formula which can skip certain values and only show the values you want. Bare with me
I have items in cell E6:E20 and F6:F20, and a date above both, what I need this to do is when I insert a date into J5, it looks at the dates in Column E5, and F5 and whatever the items are under those dates would show up under the date I entered in J5.

So in the example I have 11/7/2021 in cell J5, So I want the items under E5 because that's what matches my date in J5. But I do not want to include any of the Cells which say "Off, Call Off, No Show, Training.
Then Also if I enter 11/8/2021 in J5, I would want the items under F5 to populate under J5, again minus any words which say "Off, Call Off, No Show, Training.

No idea if this is possible and I know it sounds really confusing

TestMS.xlsx
DEFGHIJKLMN
3Example 1Example 2
4
511/7/202111/8/202111/7/202111/8/2021
61ChevyCord1Chevy1Cord
72FordPaper2Ford2Paper
83MercuryCard3Mercury3Card
94NissanOff4Nissan4Marker
105TreeMarker5Tree5Sun
116CloudsSun6Clouds6Grass
127OffGrass7Gmc7Pipe
138Call OffNo Show8Ground8Video
149GmcPipe9Plastic9Computer
1510GroundVideo10Desk10Sheet
1611No ShowComputer11Phone11Mouse
1712PlasticOff
1813trainingSheet
1914DeskOff
2015PhoneMouse
21
Sheet1
 

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
limo let's get the ball rolling. Now usually this creates more questions than answers but we have to start some place. Here is a program that will do what you have asked. If we are lucky, some of the A Students will weigh in and show us even better solutions. Let the discussion begin.


VBA Code:
Option Explicit

Sub Trans01()

Dim CellCnt As Integer
Dim i As Integer
Dim row1 As Integer

CellCnt = Cells(Rows.Count, "E").End(xlUp).Row
row1 = 6
If Range("J5") = Range("E5") Then
For i = 6 To CellCnt
If Cells(i, 5) <> "Off" And Cells(i, 5) <> "Call Off" _
And Cells(i, 5) <> "No Show" And Cells(i, 5) <> "training" Then

Cells(row1, 10) = Cells(i, 5)

Cells(row1, 9) = row1 - 5
row1 = row1 + 1
End If

Next i
End If

If Range("M5") = Range("F5") Then
row1 = 6
For i = 6 To CellCnt
If Cells(i, 6) <> "Off" And Cells(i, 6) <> "Call Off" _
And Cells(i, 6) <> "No Show" And Cells(i, 6) <> "Training" Then

Cells(row1, 13) = Cells(i, 6)

Cells(row1, 12) = row1 - 5
row1 = row1 + 1
End If
Next i

End If

End Sub


21-11-21 Date.xlsm
DEFGHIJKLM
3Example 1Example 2
4
511/7/202111/8/202111/7/202111/8/2021
61ChevyCord1Chevy1Cord
72FordPaper2Ford2Paper
83MercuryCard3Mercury3Card
94NissanOff4Nissan4Marker
105TreeMarker5Tree5Sun
116CloudsSun6Clouds6Grass
127OffGrass7Gmc7Pipe
138Call OffNo Show8Ground8Video
149GmcPipe9Plastic9Computer
1510GroundVideo10Desk10Sheet
1611No ShowComputer11Phone11Mouse
1712PlasticOff
1813trainingSheet
1914DeskOff
2015PhoneMouse
Transfer
 
Upvote 0
In case you prefer a formula.

=FILTER(INDEX(B4:C18,,MATCH(J5,B3:C3,0)),MMULT(IF(INDEX(B4:C18,,MATCH(J5,B3:C3,0))<>TRANSPOSE(M12:M15),--ISTEXT(INDEX(B4:C18,,MATCH(J5,B3:C3,0))),0),{1;1;1;1})=4)
 
Upvote 0
1636780984560.png
You also are supposed to create a little list with the terms to avoid for easy management.
 
Upvote 0
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If the formula suggestion in post #3 works for you then you likely also have the LET function so this much shorter one would also work.

21 11 13.xlsm
EFGHIJKL
1
2
3Example 1
4
511/07/202111/08/202111/07/2021Exclude
6ChevyCordChevyOff
7FordPaperFordCall Off
8MercuryCardMercuryNo Show
9NissanOffNissanTraining
10TreeMarkerTree
11CloudsSunClouds
12OffGrassGmc
13Call OffNo ShowGround
14GmcPipePlastic
15GroundVideoDesk
16No ShowComputerPhone
17PlasticOff
18trainingSheet
19DeskOff
20PhoneMouse
21
List with exclusions
Cell Formulas
RangeFormula
J6:J16J6=LET(f,FILTER(E6:F20,E5:F5=J5),FILTER(f,ISNA(MATCH(f,L6:L9,0))))
Dynamic array formulas.


If you have MS365 but do not yet have the LET function then this should do it

Excel Formula:
=FILTER(FILTER(E6:F20,E5:F5=J5),ISNA(MATCH(FILTER(E6:F20,E5:F5=J5),L6:L9,0)))
 
Upvote 0
If you do not have MS365 here is an alternative formula approach for Excel 2010 or later.

21 11 13.xlsm
EFGHIJKL
1
2
3
42
511/07/202111/08/202111/08/2021Exclude
6ChevyCordCordOff
7FordPaperPaperCall Off
8MercuryCardCardNo Show
9NissanOffMarkerTraining
10TreeMarkerSun
11CloudsSunGrass
12OffGrassPipe
13Call OffNo ShowVideo
14GmcPipeComputer
15GroundVideoSheet
16No ShowComputerMouse
17PlasticOff 
18trainingSheet 
19DeskOff 
20PhoneMouse 
21
List with exclusions (2)
Cell Formulas
RangeFormula
J4J4=MATCH(J5,E5:F5,0)
J6:J20J6=IFERROR(INDEX(E:F,AGGREGATE(15,6,ROW(E$6:E$20)/(ISNA(MATCH(INDEX(E$6:F$20,0,J$4),L$6:L$9,0))),ROWS(J$6:J6)),J$4),"")
 
Upvote 0
If you do not have MS365 here is an alternative formula approach for Excel 2010 or later.

21 11 13.xlsm
EFGHIJKL
1
2
3
42
511/07/202111/08/202111/08/2021Exclude
6ChevyCordCordOff
7FordPaperPaperCall Off
8MercuryCardCardNo Show
9NissanOffMarkerTraining
10TreeMarkerSun
11CloudsSunGrass
12OffGrassPipe
13Call OffNo ShowVideo
14GmcPipeComputer
15GroundVideoSheet
16No ShowComputerMouse
17PlasticOff 
18trainingSheet 
19DeskOff 
20PhoneMouse 
21
List with exclusions (2)
Cell Formulas
RangeFormula
J4J4=MATCH(J5,E5:F5,0)
J6:J20J6=IFERROR(INDEX(E:F,AGGREGATE(15,6,ROW(E$6:E$20)/(ISNA(MATCH(INDEX(E$6:F$20,0,J$4),L$6:L$9,0))),ROWS(J$6:J6)),J$4),"")
I apologize I am using Excel 2019, This formla looks great but when I do it, it still put the terms, Off, Call Off, No Show, etc in the rows J6:J16, I know I am doing something wrong
 
Upvote 0
I apologize I am using Excel 2019, This formla looks great but when I do it, it still put the terms, Off, Call Off, No Show, etc in the rows J6:J16, I know I am doing something wrong
Never mind, it works, thank you sooooo much!!! Thank you everyone who replied
 
Upvote 0
Never mind, it works, thank you sooooo much!!! Thank you everyone who replied
You're welcome. Glad we could help. Thanks for the follow-up. :)

Thanks also for updating your profile. (y)
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,716
Members
448,985
Latest member
chocbudda

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