# Return Column Number When Specific Text Is Found

Apr 29, 2014

I am looking for a formula to return the column number of the array when a specific text is found, in this case the text is "Yes"

The Array will only ever be 5 cells beside each other in a row

for example, M4:Q4, will be as follows - No No No Yes No

I want a formula to look at these 5 cells and return the number 4 as that is where the "Yes" value is

## Searching A Column For Specific Text To Return A Number Of Items Found

Apr 28, 2006

on one sheet we have a summary of the main list, which includes totals of money recieved, totals of all the different sources (ie, where they heard about us from), the totals of the frequencies they pay (ie, how many donate monthly, quarterly...) ... etc. on the next sheet we have the "main" list of donors, their IDs, amounts, frequency, source ...

the totals on the first sheet are updated manually, but i want to change that as there are a great number of errors.

## Lookup Names Within Text And Return That Name To Separate Column If Found

Jun 13, 2013

I'm using a formula to lookup names within text and return that name to a separate column if it's found.

The formula is =INDEX(\$E\$1024:\$E\$1026,MATCH(FALSE,ISERROR(FIND(\$E\$1024:\$E\$1026,E1010)),0))

I understand index and match functions, but I'm confused regarding the use of FALSE as the lookup value and the iserror(find( usage.

## Return Yes If Text Is Found Within A Cell

Dec 24, 2013

I currently have the below formula to search for text of interest (A1) within each cell of a column (B6:B30).

=IF(ISERROR(MATCH(A1,\$B\$6:\$B\$30,0)),"NO","YES")

The formula works perfectly if there is only a single value in the cells. But not so well when the cell has multiple values separated by a comma.

For example:

Column B

X
Y
Z
T, X, Y, Z

It would return a "Yes" for X, Y, and Z because those are found individually. However, T will appear as a "No", because it is found within a cell that is separated by commas.

## Lookup Value & Return Text If Found

Sep 15, 2006

Im trying to create a formula that check to see if the value in H4 equal any value in the vlookup table m4:m48, if so, then Y, if not then N. the following does not work: =IF(ISNA(MATCH(H4,M\$4:M\$48)),"N","Y")

## Search Sheets For Value & Return Sheet Number When Found

Feb 16, 2008

i have a workbook with several sheets in it. i would like to make a userform were i could put a number in a text box eg E045698.then use a command button to search all the worksheets for that number and display the sheet number where that number is in another textbox.

## Use A Column Of Data If A Specific Value Is Found

Jun 11, 2006

I have a set of data (time in minutes) below (fig 1) that I need to use if the total time between two entered times matches a coloms total. If it matches I want Excel to use the data in that colom to affect the data in another (fig 2) colom adding the times to each cell.

Looking at both figs. below I want Row B, Colom A in fig 2 to add Row A, Col A to Row A, Col A in fig 1 since both are the total of 19.

fig 1
Coloms A B C D
Row A 5 5 6 6
Row B 5 6 6 8
Row C 4 5 6 7
Row D 5 4 4 5
Total 19 20 23 26

fig 2
Coloms A B C D
Row A 1:00 2:00 3:11 4:01
Row B
Row C
Row E
Row F 1:19 2:20 3:33 4:27
Row F-A= 19 20 23 26

## VBA Code To Stop Macro If Specific Text Is Found

Feb 24, 2012

I have a simple macro that copies data from worksheet to another. I only want this macro to be run once per day by the user. One of the cells that gets copied is the value found in the formula "=today()". My thought is that the macro could look for the existance of the current date in the pasted data (meaning the macro has already been run once today), and if the date = today, then a message pops up warning the user that the macro has already been run once today, and ask if they're sure they want to continue.

Any easy way to accomplish what I'm attempting to do? The current date gets pasted into a worksheet name "PriorDay" in cell C5.

## Count Of Cells Where Occurrence Of Some Specific Text Is Found

May 28, 2013

I have a spreadsheet that lists all the work done by employees within a specific area. Some employees cover multiple areas.

I am now needing to work out the average work completed by each area. I need a formula that will count the number of employees by each work area.

I know this is something I have done before, but my mind has gone blank and I can't for the life of me work it out again (it's one of those days).

Row 3 of the spreadsheet contains the codes for the work areas they cover (CM, V & TC) and some employees only cover one (which would be a simple CountIf) but some have multiple.

What is the formula to, for example, count the number of people who have CM in row 3 even if they also have other entries in that cell.

## Calculate If Specific Word Found In Column

Feb 15, 2008

I would like to use the following code to see if the word "reservoir" shows up in any of the rows in a certain column. If it does I want to insert the formula = SUM(D7:D257)*0.1 into cell C2 and if it doesn't then I want to put a 0 into cell C2. I've tried many routes but can't get past the error if it can't find the word.

Range("B7:B257").Find(What:="Reservoir").Activate

## Return TRUE If Part Text Found In Cell Range

Feb 27, 2012

The formula has to include a range across each row (for each student). The formula has to search for specific text contained in the classnames, and then return the result along the same row.

Below is an example, which I hope saves OK in the thread. If not I'll upload an Excel file:

A B C D Results:-
1 class1 class2 class3 class4 Gg Hi Fr Sp
2 10m/Gg1 10m/Hi2 10m/Fr1 10m/En1 TRUE TRUE TRUE FALSE
3 10n/Hi1 10n/En2 10n/Sp1 10n/Ma1 FALSE TRUE FALSE TRUE

## Lookup Column Values In Another & Return Value If Match Found

May 28, 2008

I need to create a macro that will loop through a list of names on Sheet 1 / Column A, and if that name is listed on Sheet 2 / Column A, then it will set Sheet 1 Column B (for that one name) to "1".

The problem I've run in to is that both the lists change in length each time I have to run this (so no set range).

I've been able to get this to work with two ( nested) loops, where the first loop goes through the Sheet 1 list and the nested Loop looks for the name on Sheet2, but it is extremely slow.

Is there any simple VBA code or formula that I'm missing that could do this? I've tried to do something with the " Find" VBA command, but I can't see how it would apply to this if the list changes in size.

## Looking To Find 1 Of 2 Words In A Cell In Column B And Return Word Found In The Same

May 27, 2014

Looking to find 1 of 2 words in a cell in column B and return the word found in the same row in column E. This seemed easy but I am not having any luck.

the cells in column B have several words in them but I am looking for 2 specific words "PLAT" and "ORIG". If the word is not in the cell, it should show a blank cell in column E in the same row, otherwise one of the 2 words should be in that row in column E. A VBA loop would be ideal but a formula that can do it might work as well.

## Return Text From Left-hand Side Of Ragged Array Where Entry Found

Apr 11, 2012

I've been given a spreadsheet that is poorly constructed but I'm not allowed to alter.

The layout is:
Box Name Box Date ID1 ID2 ID3 ....
Where there is not a fixed number of IDs in each box
(There are five different sheets so I'll have some fun concatenating results)

Given a list of IDs I need to return the box name and box date that the ID's file sits in. The spreadsheet has blanks everywhere and the numbers contained in rows are non-consecutive and smaller values can appear later in a column than larger ones.

I think I need some combination of index, offset and maybe sumproduct? TBH, I avoid sumproducts like the plague, preferring to utilise sumifs and dynamic named ranges since this improves clarity so I'm basically a newb at them.

Any skeleton framework that you think would work to return the text values for the LHS where the number could be anywhere? Once I can see a rough example I should be able to get to grips with the logic and wrangle it into the necessary solution.

## Highlight Only First Duplicate Number That Found In Column?

Aug 24, 2013

I have sheet 1 and in c3
d3

1st
copy

[Code]....

this two column compare for duplicates and I manage to highlight (actually not bold) the number that is duplicate but I dont want to highlight the 2nd, 3rd & so on duplicate number in c3 (highlight 1 only from the 3 numbers most of the times got 2 only) . (row start from c3 to c2000 and d3 is up to d2000 also). I already use CF for highlighting the duplicate in C3 which my formula in CF is

=IF(ISERROR(MATCH(c3:c3,\$c\$3:\$c\$780,0)),"",c3:c3) I just try to do this formula and it works, but I dont know how to command not to highlight the 2nd, 3rd & so on duplicate number in C3 (C3 only can have duplicate number within the column; D3 doesn't have any repeat number in the D column.

I need to do the same formula command for other 2 partner columns (compare for duplicates this two columns & the 1st column if have to many duplicates highlight the first number that have more than 1 duplicates only) cells need to do again is for E3 & F3; G3&H3; until AU3&AV3..

is it possible to count how many highlighted cell (not bold) there is in a column (I mean total highlighted cell) and put the answer in cell C1, E1, G1, I1 ... AS1 , AU1. Tq again..

## Highlight Only First Duplicate Number That Found In A Column

Aug 23, 2013

I have sheet 1 and in

c3
d3

1st
copy

1347
0934

[Code] .......

This two column compare for duplicates and I manage to highlight (actually not bold) the number that is duplicate but I dont want to highlight the 2nd, 3rd & so on duplicate number in c3 (highlight 1 only from the 3 numbers most of the times got 2 only) . (row start from c3 to c2000 and d3 is up to d2000 also). I already use CF for highlighting the duplicate in C3 which my formula in CF is

=IF(ISERROR(MATCH(c3:c3,\$c\$3:\$c\$780,0)),"",c3:c3)

I just try to do this formula and it works, but I dont know how to command not to highlight the 2nd, 3rd & so on duplicate number in C3 (C3 only can have duplicate number within the column; D3 doesn't have any repeat number in the D column.

I need to do the same formula command for other 2 partner columns (compare for duplicates this two columns & the 1st column if have to many duplicates highlight the first number that have more than 1 duplicates only) cells need to do again is for E3 & F3; G3&H3; until AU3&AV3..

is it possible to count how many highlighted cell (not bold) there is in a column (I mean total highlighted cell) and put the answer in cell C1, E1, G1, I1 ... AS1 , AU1. Tq again..

## Count Number Of Keywords (range) Found In Text String

Aug 23, 2013

I am trying to count the number of specific words contained in a specific cell. If my data were static, and the list of keywords was short, there are many solutions such as using multiple instances of the length function as proposed by @shg here.

Suppose I have the following sheet: (column C is what I am trying to achieve)

A
B
C
1

[Code]....

That is, C2 will tell that B2 contained 3 of the keywords (1X beautiful, 2X happy) and so on.

## Combine Found Row Number With Column Letter To Become Range And Then Count

Jul 8, 2012

I am having troubles finding a row number, using it to specify a range and then counting the cells containg values in that range.

This is what I have

Code:
Private Sub TextBox1_Change()
Dim test1 As String
Dim FoundRom As Range
Dim i as String
Dim abc1 As Range
Dim Core1 As String

test1 = TextBox1.Value

[Code] ........

I am thinking that I have my "Dim"'s wrong or something but I cant figure out how to define the range including the found row number and then count the number of cells containing data within that range...

## If Text Found In Cell Then Place A 1 In Another Column

Dec 21, 2009

What I would like to do is if a string e.g. "*12/18/09*" is found in column A, then place "1" in column B. There are many rows that I would like to search. Either a formula or VBA would be fine.

## Find Text & Offset By Found Value Row And Column

Apr 16, 2008

I'm writing some code where I need to know the column in which a specifc text string occurs. Because of the nature of the sheet, the string will only appear in one column, but that could be in almost any column on the worksheet.

For example say the text string is "Year 1", I need to find the column with this string, and then offset down to a predetermined row, or offset over to the appropriate column (something like below).

With Selection
.Offset(0, x).Select
If List.Selected(0) = True Then
y = i - 1
With Selection
.Value = Salary * Inflation1 ^ y
End With
Else

## If Cell Contains Specific Text Return That Text

Jun 12, 2014

How would I pull only a specific word from a text cell? If you see my example, in one column I have various job titles. If A2 contains "Manager", then in B2 return "Manager. If A1 contains "Coordinator", return "Coordinator. Etc.

Excel Forum.jpg

## Find Text/Value & Use Found Cell, Row, Column In Macro Code

May 10, 2008

I am trying to clean up and simplify my macros by compartmentalizing frequently repeated commands. I like to search for text in column headings and define the cell containing it as a range that I can later use .column or .row commands on, so my macros are a bit more flexible. The code I currently use for this is

Dim XColumn As Range ‘the cell containing the text “X”
Cells.Select
Selection.Find(What:="X", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Set XColumn = ActiveCell

I would like to be able to create a Macro (possibly name FindSetCell()) that will accept arguments and achieve the results of the above code in other macros
I think the command might look something like FindSetCell(“text to be searched for”,”name of newly Defined Range”) But I have not figured out how to code it

## Return Number Of Cells With The Most Consecutive Specific Values?

Aug 13, 2014

I have a range of say B1:Z2. In row B1:Z1 I have dates in the format dd-mmm-yy. In row B2:Z2 I indicate presence of a person by "P". This is at infrequent appearance i.e. p,p,p,blank,blank,blank,p,p,p,p,p,blank,blank,p,p,blank,p,p,p, etc. I am trying to find or workout a formula that would find the most repetitive Ps in row B2:Z2 and give me the sum thereof. I.e, from the above example it should be 5. It does not have to count specifically P. Something that counts the most non-blank sequence of cells in the range should also do.

## Return Array Index Number For Specific Date

Jun 14, 2008

I looking for a macro which will help to open a file with current week number in name.

The problem is week 1 is starting on 30/03/2008 (finacial year) and ends on 28/03/2009.

I've made two dimensional array (week number, weekday) with all the dates from that period.

I have problem with code to search through the array for given key, return index and write it into variables.

For now my code looks like:

Sub week()

Dim i As Long
Dim j As Long
Dim k As Long

Dim week(51, 6) As String

## Look Up Specific Text In Row Then Return Its Grouping In Another Row

Jun 19, 2014

I have a list of names, and each name belongs to a particular group

I want the group number to auto populate in row 2, so when Andrew adds his name on the bottom of the list, row 2 returns a value of 1, Barry, group 2 and so on.

The list of names and groups will remain the same over time, but the list will be repeated each time that the individual inputs his name.

All information is in one sheet as below

Name
Group

Andrew
1

Barry
2

[Code] ........

## Macro To Query Column For Date If Found Place Text In Cell

Aug 30, 2012

I am trying to make a macro that will query a column J4 for a date, if the date is found say "Wednesday, July 4, 2012" (J8) get the text from Column K8 "Independence Day" and insert the text in Cell (H1).

The Macro Prints sign in sheets with the date in H2, it only prints Monday through friday. Then skips the weekend and the next date will start the following Monday.

The Federal Holiday schedule is in column range J (Date) and K (Holiday)

This is where I am stuck ....

EmployeeTimeSheet_2012.xlsm

## Return Value Of Specific Column?

Mar 6, 2014

if I wan to get the value of specific column, how should I use it by vlookup?

The formula for vlookup is like is =vlookup(lookup value,table array, col_index,range lookup)

If the col index range, can i specific any column, example of I lookupvalue from A, then get value from CH?

## If Text Found In String Return String

Jan 31, 2008

Find a short text string in a column of longer text strings and when that short text string is found return the longer text string that matches.

## Delete A Row If It Has A Specific Text In A Specific Column

Jun 21, 2006

I need a code that will delete a row if it has a specific text in a specific column.

In this case in column W if there is anything that starts with '>TC' I need that entire row deleted that its in.

## VBA To Number Rows In A Column But Starting From Specific Number

Mar 10, 2014

I would like to create a vba script when ran an input.box comes up and asks you to "enter number you want to start numbering from" and when the number is entered in the input box. e.g "7654", excel starts numbering each cell in column A from 7654 until there is an empty cell in column B.