Excel How to extract two digits from Column A
NickName:bv03a Ask DateTime:2022-09-15T15:28:21

Excel How to extract two digits from Column A

I have a question about Excel How Can I extract two digits from Column B if Column B is empty extract two digits from column A. I know how to extract two digit from Column B but cannot understand how to do it if column B is empty.

for example: in column B in first row we have 123456 number we extract first 2 digits to column C, but in next row in column B is empty but column A is not empty and we need to extract number from column A.

Thanks for helping!

Copyright Notice:Content Author:「bv03a」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73727158/excel-how-to-extract-two-digits-from-column-a

Answers
Terio 2022-09-15T07:34:07

You must check the contents of the cells and extracts the digits if not blank\nC2\n=IF(B2="",IF(A2="","",LEFT(A2,2)),LEFT(B2,2))\nBye",


More about “Excel How to extract two digits from Column A” related questions

Excel How to extract two digits from Column A

I have a question about Excel How Can I extract two digits from Column B if Column B is empty extract two digits from column A. I know how to extract two digit from Column B but cannot understand h...

Show Detail

Extracting digits from strings in excel with condition

Say we have strings like this and want to output digits out from it. The digits is not always in the beginning so I think I need to define condition as well. Tried this Excel: Extract Numbers from ...

Show Detail

Extract numbers buried in excel by count of digits

I have a pretty complicated excel task I am completely stumped on. I am trying to extract a 7-digit integer from a page scrape of a PDF and the issue is that it can be surrounded by both text and o...

Show Detail

Extract a set of digits from a string column in MySQL

I am trying to extract a fixed-length digits from a string column in MySQL, how can I go about doing so? The usual like and regexp doesn't work, so am pretty certain a function is needed, but unsure

Show Detail

Extract up to two more digits

This may be a very simple question but I have not much experience with regex expressions. This page is a good source of regex expressions but could not figure out how to include them into my follow...

Show Detail

Is there a way in pyspark to extract digits /alphabets from alphanumeric column

I want to extract the numerical digits from an alphanumeric string column into another column which will contain only digits and not alphabets using pyspark.

Show Detail

How to extract column from excel file?

What be the best method to extract a column set of data? I have Matlab code for this data analysis, but I want to use Python. Excel file How would extract individual columns and put them into a co...

Show Detail

how to extract digits and letters

how can i make a function that extracts digits and letters from tokens,i am trying to work on a lexical analyzer in c sharp which extracts variables datatypes liberaries from a cpp file i want my

Show Detail

how to extract the digits from the center of a column of data in a dataframe in pandas?

I want to know how to extract the 3 digits from the center of the data from a column of a dataframe, which can change the number of digits. To do this I used the function str[1:4], where '1' is the...

Show Detail

Extract first 3 digits from a Pandas column

I have a dataframe df: codeID 0 4829 1 2348 2 401 3 281 4 Z3995 5 O888 6 v71.9 7 NaN 8 Z863 3 9 9 10 50 I wanted to

Show Detail