An OR statement - excel

I'm attempting to combine these 2 statements with an OR statement. The first is a number that has to be shortened by 3 digits to the left. And the second is an alphanumeric statement that is 6 digits long. I was thinking =--(OR(MID(B2,4,7),MID(B2,1,7))). Can anyone help?

=Concatenate(Right(text(B2,0),len(text(B2,0))-3),Left(text(B2,0),6))
I had to take a big guess at what you were trying to achieve based on your question.

Related

Removing first two digits in Excel if the character length is greater than certain number

I have cell phone numbers in Excel some with country code- 91 and some without country code. I need to remove the country code. We have 10 digit phone numbers so I need to remove the first two digits if the character length of the cell is greater than 10, i.e. if I have a number with country code like 917465785236 I need to remove the first two digits- 91 so that I only have 7465785236. I am trying the below piece but it doesn't check the IF condition and removes the first two digits from all the cells. Can someone tell me what's wrong I am doing here:
=IF((LEN(A1>10)),RIGHT(A1, LEN(A1)-2))
You probably need to put the parentheses differently for the Len function:
=IF((LEN(A1)>10),RIGHT(A1, LEN(A1)-2))
You're not using the parenthesis properly. Also since you strictly want to have 10 characters, you don't need to calculated the length in the RIGHT formula.. It needs to be like this:
=IF(LEN(A1)>10,RIGHT(A1, LEN(A1)-2),A1)
Now, that is the issue with your formula, but the solution to your question doesn't even need a IF statement, You can simply use:\
RIGHT(A1,10)
It will automatically get the 10 characters at the end and remove the rest.

How to get rid off only certain zeros formula?

Ok so I had a nice formula until a problem came along. Basically I needed to get rid off a zeros in the middle of a 10 characters String/Range i.e AB00005879 to do that I have used formula SUBSTITUTE(NameRange,"0","") which gave me nice AB5879 solution. Sometimes the number at the end would only be 3 digit long AB00000975 so my formula would give me AB975 All great until I stumble a problem. Some of the strings came in a form of i.e. AB00004020 So my formula extracted every zero leaving me with AB42. Is there a way to extract only first four zeros in a middle an always keep the number at the and? so the last scenario would look like AB4020. Thanks in advance
SUBSTITUTE(NameRange,"0",""))
If you always have two characters at the start and then some zeros and then some numbers, all of which you want to keep, this should work
=LEFT(A1,2) & VALUE(RIGHT(A1,LEN(A1)-2))
EDIT #2
If your string always starts with two letters such as AB following by a random number of zeros and then a number string that you want to keep, try
=LEFT(A1,2)&RIGHT(A1,11-AGGREGATE(15,6,ROW($3:$10)/(--MID(A1,ROW($3:$10),1)>0),1))
Replace A1 with your actual case.

Alteryx separate the first integer of a number and put it in a new column

I only have one column that has an 8-digit number. No dots, commas or any conjugation. Only integers.
I simply want to extract the first integer from the number and put it to a new column named "First integer". I want the rest of the integers, untouched, to either go to a new column as they are, or stay in the existing column but without the first integer
for example now I have: columnA: 23456789
I want First Integer:2 columnA: 3456789
I am pretty new to Alteryx so that might even be a ridiculous question to some :P
But any help is greatly appreciated :)
Suppose [i] is the relevant numeric field in your Alteryx workflow.
Then using a Formula tool, this expression will give the first digit:
[i]/POW(10,FLOOR(LOG10([i])))
And this will give the remaining digits:
MOD([i],POW(10,FLOOR(LOG10([i]))))
Explanation: working inside-out: Log10([i]) tells you how many powers of 10 you're working with, FLOOR just rounds that off, POW(10,...) multiplies it back out... so basically for an 8 digit number, this gives 10,000,000. Then you simply divide to get the first digit, or take the MOD (modulus) to get the remaining digits.
PS, your question mentions an 8-digit integer... if you are absolutely certain that your integers always have 8 digits (and the first digit is not a zero), then you can shortcut this: firstDigit=[i]/10000000 and remainingDigits=MOD([i],10000000).

Add a comma after certain digits in Excel

I have a column (F) full of 11 digit numbers, what I need is to split them like the following: 12,345,6789,00
I have the following formula which adds a comma after the first two digits however I don't know how to get it to add them in after the next 3 then 4.
=LEFT(F2,2)&","&MID(F2,3,LEN(F2))
The above formula outputs like this: 12,345678900
Any suggestions?
Have you considered using the TEXT function? This is simple and would do the trick:
=TEXT(F2,"00"",""000"",""0000"",""00")
Use MID all the way:
=MID(F2,1,2)&","&MID(F2,3,3)&","&MID(F2,6,4)&","&MID(F2,10,2)
=left(F2,2)&","&mid(F2,3,3)&","&mid(F2,6,4)&","&right(F2,2)
Will give you what you want.
=LEFT(F2,2) &","&MID(F2,3,3)&","&MID(F2,6,4)&","&RIGHT(F2,2)
Try using the Text to Columns function in the Data Tab of Excel. It will allow you to split the numbers based on number of digits. For this to work though, it needs to be the case that the number ALWAYS has 11 digits... otherwise some numbers will get cut in the wrong spot.
You can then Concotenate them back together with Commas inbetween.

Excel conditional counting

This is a doubt that arose in my workplace, and it should be pretty straightforward.
We have two columns of numbers, say:
1 1
1 2
2 1
2 2
And we want to get the number of rows that have equal numbers (2), without a helping column for each comparison. We can't get a working matrix operation (wich is the way we think correct). Any ideas?
Thanks in advance!
Three more to pile on here:
Condensed array function:
{=SUM(--(A1:A10=B1:B10))}
Same function, but wrapped in a SUMPRODUCT rather than an array function:
=SUMPRODUCT(--(A1:A10=B1:B10))
Ignores blanks:
=SUMPRODUCT(--(A1:A10=B1:B10)*NOT(A1:A10="")*NOT(B1:B10=""))
We got it using:
{=SUM(IF(A1:A10=B1:B10;1;0))}

Resources