hii ...i have two columns in a excel having yers in one like 6th year ...and one more column named xyz having a digit or number lke 7 ...i want to compare both columns row wise and return me the cases where 6th year in one column and digit is also 6 same for 7th yaer 7 9th yaer 9 ..these cases so any frmila for yhid
Assistant
You can achieve this in Excel using a formula that compares the year with the corresponding digit from the second column. Here's a step-by-step guide on how to do it:
Step 1: Set Up Your Data
Assuming:
Column A contains the years (e.g., "6th year", "7th year", "9th year").
Column B contains the digits (e.g., 6, 7, 9).
Step 2: Write the Formula
You can use the following formula to check if the year and the digit match:
In a new column (let's say Column C), enter this formula in row 1 (assuming your data starts from row 1):
=IF(VALUE(LEFT(A1, FIND(" ", A1)-1)) = B1, "Match", "No Match")
User
my one column is year and cother is last
Assistant
Thank you for the clarification! It looks like you have one column for the year (e.g., "6th year", "7th year", etc.) and another column labeled "last" that contains a number. You want to check if the number at the end of the year string matches the number in the "last" column.
Step-by-Step Guide
Assuming:
Column A contains the years (like "6th year", "7th year", "9th year").
Column B contains the "last" digits (e.g., 6, 7, 8, 9).
User
column A named as year and B has last ....now write fromula as these names
Assistant
Thank you for clarifying the column names. If you have one column named "Year" in Column A (e.g., containing values like "6th year", "7th year") and another column named "Last" in Column B that contains the numbers (like 6, 7, etc.), you can use the following formula to check for matches using those exact column names.
Step-by-Step Formula
Assuming your headers are in Row 1 (i.e., "Year" in A1 and "Last" in B1), you would enter the following formula in cell C2 (the first row of data):
=IF(VALUE(LEFT(A2, FIND(" ", A2)-1)) = B2, "Match", "No Match")
Explanation of the Formula:
Explanation of the Formula:
LEFT(A1, FIND(" ", A1)-1): This part extracts the number from the "6th year" format. It looks for the first space and takes the text before that space.
VALUE(...): This converts the extracted text to a number.
B1: This is the digit you want to compare with.
IF(...): This checks if the number extracted from Column A matches the number in Column B. If they match, it returns "Match"; otherwise, it returns "No Match".
Step 3: Drag the Formula Down
Click on the bottom-right corner of the cell where you entered the formula (a small square will appear) and drag it down to apply the formula to all the rows of your data.
Step 4: Filter the Results
After applying the formula, you can filter Column C to show only "Match" to see cases where the years and digits correspond.
Example
A
B
C
6th year
6
Match
7th year
7
Match
8th year
6
No Match
9th year
9
Match
This will effectively help you identify the rows where the years and the digits are equal.
Step 1: Write the Formula
In a new column (let's say Column C), you can use the following formula to check whether the number extracted from the "year" column matches the "last" number:
In cell C1, enter the following formula:
=IF(VALUE(LEFT(A1, FIND(" ", A1)-1)) = B1, "Match", "No Match")
Explanation of the Formula:
LEFT(A1, FIND(" ", A1)-1): Extracts the number (e.g., "6", "7") from the "6th year" text by finding the first space and taking the text before it.
VALUE(...): Converts the extracted text to a number to allow numerical comparison.
B1: This is the digit in the "last" column you want to compare with.
IF(...): This checks if the extracted number matches the number from Column B.
Step 2: Drag the Formula Down
After entering the formula in C1, drag the fill handle down (the small square at the bottom-right corner of the cell) to apply the formula to all rows.
Example
A
B
C
6th year
6
Match
7th year
7
Match
8th year
6
No Match
9th year
9
Match
Step 3: Filter the Results
You can filter Column C to display only "Match" to easily identify the rows where the number in the year column matches the number in the "last" column.
Note
If your data starts from a different row (for example, if you have headers), make sure to adjust the formula accordingly (e.g., starting from C2 instead of C1).
By following these steps, you will be able to compare the two columns and find the matching cases!
LEFT(A2, FIND(" ", A2)-1): This part extracts the number portion from the "Year" column (e.g., it gets "6" from "6th year").
VALUE(...): Converts the extracted text to a number for proper comparison.
B2: This is the cell in the "Last" column that you want to compare the extracted number against.
IF(...): This checks if the extracted number matches the number in the "Last" column. It returns "Match" if they are equal and "No Match" if they are not.
Step 2: Drag the Formula Down
After entering the formula in C2, click on the small square at the bottom-right corner of the cell (the fill handle) and drag it down to fill the formula for all the relevant rows in your dataset.
Result Display
Your Excel sheet should look like this:
Year
Last
Result
6th year
6
Match
7th year
7
Match
8th year
6
No Match
9th year
9
Match
Step 3: Filtering Results
You can now filter the "Result" column to show only the rows containing "Match" to easily identify where the values align.