If cell does not contain specific text, then return a that missing text

Aharris90

New Member
Joined
Jul 13, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am hoping someone can help. I am trying to run a formula that will search a column for text and if that text does not match text within another column to then return the missing text to the bottom of the column the text is missing from.

So lets say Column A has 100 records and Column B has 75 records, I would like row 76 in column B to return the first missing text from Column A.

I hope that makes sense.

Thanks
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi

not quite sure to understand exactly, but would you not just use "=a1" in cell B1, and then copy the formula down the page to the empty cells ?

From your description above, you are suggesting that your desired goal is to have column B = to Column A ?

Is that correct ?

maybe some examples of actual (or dummy) data might help ?

thanks
Rob
 
Upvote 0
Hi Rob,

Thanks for your reply. I have attached a screenshot of some dummy Data. Column "Query Data" is pulled from our database and is a list of customers that have actually ordered with us in the year. Column "Sales Forecast" is a list of the customer sales said they would take an order from.

What we are trying to do is track the accuracy of the sales forecasts. So we are having the file lookup where the names match in the two columns and pull throught the acutal order value vs the forecasted value which is easy.

The part we are now trying to solve is that there could be a customer in Column "Query Data" that is not in Column "Sales Forecast" as we perhaps never knew about that customer when we did the forecast so rather than having to spot the ones that are missing in Column "Sales Forecast" compared to "Query Data" manually we would like it to enter the text to the bottom of the "Sales Forecast" Column. AS you see in that data Customer 12 we have received an order for but we did not expect it as the sales team did not forecast it. We would therefore like a formula that will add the text "Customer 12" or whatever the name of the missing customers are in the column "Sales Forecast". Then as we run the query each week as more add in for the formula to keep adding them from Column A to the bottom of Column B where I have placed the red Text.

It seems simplier in this limited data size to spot but the real data has 600 customers and the order is not the same in each column. Does that help?
 

Attachments

  • Capture.JPG
    Capture.JPG
    59.4 KB · Views: 14
Upvote 0
In B12 then copy down
Excel Formula:
=IFERROR(INDEX($A$2:$A$13,Aggregata(15,6,ROW($A$2:$A$13)/(COUNTIF($B$2:$B$10,$A$2:$A$13)=0),ROWS($B$12:$B12))-ROW($A$1)),"")
 
Upvote 0
Hi,

yes, thats a lot more clear, thankyou.

The downside is that I don't know of a "formula" that can handle that. A formula can act on data, but will only return a result in a specific cell if you understand me well. So for each customer thats missing, you would need an appropriate formula in the same number of cells. But of course you dont know how many are missing, so you dont know how many formulas you need to add to your sheet. I dont think its possible for a formula to act on multiple items either (eg. more than 1 missing customer).

So, it would mean some VBA code in a Macro to do the work. (which is possible). Are you familiar with VBA code at all, where it gets stored, how its run etc.? Do you have access to the "Developer" tab ?
thanks
Rob
 
Upvote 0
ah ok, looks like Srini is much more knowledgeable than me ! (as are most!) :)
Rob
 
Upvote 0
Thanks Rob. I have used VBA a really small amount and do have access to the Developer tab but am quite new to VBA to be honest. I have tried the suggestion above by Kvsrinivasamurhty but that did not return all missing values.
 
Upvote 0
@kvsrinivasamurthy if I understand your suggest correct it is working based on the gap in the dummy data set in column B. They may have been a little misleading as the data will be in consistent lists without gaps. I showed it like this to help the explanation.

 
Upvote 0
How about
Fluff.xlsm
AB
1CountyCounty
2West MidlandsWiltshire
3NorthumberlandCounty Durham
4DevonStaffordshire
5CheshireSomerset
6CornwallNorth Yorkshire
7GloucestershireWest Yorkshire
8KentEast Riding of Yorkshire
9MerseysideGreater Manchester
10East Riding of YorkshireMerseyside
11NorfolkTyne and Wear
12NottinghamshireEssex
13StaffordshireCheshire
14HertfordshireGreater London
15LancashireDerbyshire
16West YorkshireNottinghamshire
17Lincolnshire
18Wiltshire
19County DurhamWest Midlands
20SomersetNorthumberland
21North YorkshireDevon
22Greater ManchesterCornwall
23Gloucestershire
24Kent
25Norfolk
26Hertfordshire
27Lancashire
28Lincolnshire
29
Main
Cell Formulas
RangeFormula
B19:B28B19=FILTER(A2:A22,ISNA(MATCH(A2:A22,B2:B16,0)))
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,482
Messages
6,125,058
Members
449,206
Latest member
Healthydogs

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