Can't subtract text of one cell from another - excel

Is it possible to subtract text of a cell from another text of different cell? I meant to subtract text in B1 from text in A1 using excel formula.
Cell A1 contains:
FRIENDSWOOD CITY N 77546-4005
Cell B1 contains:
77546-4005
I expect the result in C1 which can be obtained subtracting A1-B1 using formula:
FRIENDSWOOD CITY N
I tried like the below one but it gives me value error:
=A1-(RIGHT(A1,LEN(A1)-FIND(" ",A1)))

Try using this formula:
=REPLACE(A1,FIND(B1,A1),LEN(B1),"")
Here's my result:

You could also try this simple formula,
=SUBSTITUTE(A1,B1,"")

Related

Google Sheets or Excel: setting the value of a remote cell from a formula

Is there a way to create a formula in one cell that will change the value in another cell based on some criteria, without scripting? Example: cell a1 contains a numerical value. cell b1 contains a value from a drop-down list, say, "YES,NO". If cell b1 is set to "YES" I want to remove (set to zero) the value in cell a1. What I'd like to do is have a formula in cell c1 that interrogates b1 and sets the value in a1 accordingly. Is the only way achieve this writing code and using setValue?
you cant remove it without a script. you can visually hide it in various ways. if the A1 is subject of further sum (as in your case per your comment) the sum formula can be always altered to reflect desired output. example:
if your formula is
=SUM(A1, C5, D22)
you can do
=SUM(IF(B1="YES", 0, A1), C5, D22)
Use the following on the cell you need the calculation (or zero) on:
=IF (B1="YES",0,SUM(A:A))
Using the given formula, you would do the SUM calculation for the whole Column A if the value on B1 is "YES", if not, then a 0 would be placed on the cell you put the formula on.

In excel, how to return nearest cell that contains date

I have a column that contains text cells and date cells. Next to each cell of text, I need the nearest cell that is above that text and contains a date to be returned.
Example
You can use INDEX/MATCH:
=IFERROR(INDEX($A$1:A1,MATCH(1,$A$1:A1,-1))/(ISTEXT(A1)),"")
You have to use a column agent (English is my second language so please give me a better way to describe it if you know), let's say column C.
Put this formula to C1:
=A1
Put this formula to C2 and fill down:
=IF(ISERROR(DATE(DAY(A2),MONTH(A2),YEAR(A2))), C1, A2)
The above formula check if A2 is a date then copy it or fill it down by the cell above.
Copy the cells you want in column B (B2:B4,...) from column C. Hide column C if you want.
Try below formula.
=IF(ISTEXT(A1),AGGREGATE(15,6,$A$1:$A$10,COUNTIF($A$1:$A1,">1/1/1900")),"")
If there are numbers also in cells rather that names then you can use below formula
=IF(LEFT(CELL("format",A1),1)="D","",AGGREGATE(15,6,$A$1:$A$10,COUNTIF($A$1:$A1,">1/1/1900")))
You can also use the LOOKUP function:
B1: =IF(ISNUMBER(A1),"",LOOKUP(2,1/($A$1:A1),$A$1:A1))
and fill down.

Combine string and cell reference and convert to formula

I'm trying to connect to a scada system via DDE function.
First column contains tags of the points that I want to get their values and second column contains the formula.
The formulas I use is as follows: =Datahub|Datasim!AAA_PV1 , Datahub|Datasim!AAA_PV2, ...etc.
Where AAA_PV1, AAA_PV2 are the variables that will be changed located at A1, A2 cells.
So how could I concatinate the constant part of the formula (=Datahub|Datasim!) with the variable part (AAA_PV1) (AAA_PV2) ...etc
Thank u in advance
You can put 'Datahub|Datasim'! in a cell, for example D1, and then use the Indirect() function.
So assuming the values are to be put in B1, B2 etc. (corresponding to the values of A1, A2 etc.) Put this formula in B1:
=Indirect($D$1&A1)

Insert a value to a cell in excel using formula in another cell

I need to insert a value to a cell in excel using formula in another cell.
Say
A1 = "Test"
B1 = formula to insert A1 to C1
C1 = A1
Can I write a formula in B1 to insert value in C1?
I don't need any formulas in C1.
If Yes, What should be the formula?
If there it is next to the cell AND has no value in B2, it is possible, otherwise it is not.
Use Split()
Split(CONCATENATE("Text for B1#Sperator$$",A1),"#Sperator$$",FALSE)
It really depends.
EDIT
Out dated. Only works in google sheets.
Without using VBA or formulas in column C you can't achieve this.
A simple solution using formulas:
In cell C1, paste the following formula and drag it down:
=IF(B1=1;A1;"")
So if the content of cell B1 is equal to 1, your cell at column C will display the respective value of the same row at column A.

Excel =if conditional question

In Excel I need to do the following:
If cell A1 contains the text, "Toronto" then in B1 I need to put "X"
So I guess a formula in B1?
=IF(A1="Toronto","X","")
is the if format. if you are confused about excel formula's simply press the equals key in a blank cell and click the insert format command (Fx) and it will walk you through the formatting.
=IF(A1="Toronto","X",FALSE)
in B1, and replace FALSE with whatever you wish to put in the cell if it's not Toronto. If you simply want to leave it blank use "".
maybe in B1 if(A1 = "Toronto","X","Y")
If you want for Cell B1 to remain Blank unless A1 contains the text "Toronto" you could use the following formula in cell B1: =IF(A1="Toronto","X","")

Resources