Combine string and cell reference and convert to formula - excel

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)

Related

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.

How to autofill column in excel?

I need to change column auto.
Fo example I need fill row a2 , a3,a4,...,zz with column value a1 , b1 , c1,...,zz.
In excel autofill rows.but I don't know about autofill column.
Is it possible with functions?
How can I do it?
You question is not so clear. If you want to obtain values from A1, B1, C1..... and so on then you can use INDIRECT() function like below.
=INDIRECT(CHAR(ROW()+63)&"1")
You can also use INDEX() function to obtain values from row.
=INDEX($A$1:$F$1,1,ROW(1:1))
And if you want to just display A1, B1, C1...... then use
=CHAR(ROW()+63)&1

How to refer to a Cell in Excel when i specify Column directly but use formula instead of specifying row number directly

Short summary, to refer to the cell C5, rather than saying =C5 , i need to use =C(a+b) , because the row number is variable and calculated using a formula, but the reference =C(a+b) doesn't work.
In Microsoft Excel, I am using =MATCH(A1, B:B, 0) to get the row number at which the value at A1 exists in Column B. For eg it returns 5. How do i refer to Column C and Row[returnedValue] i.e. C5 if i am writing the formula in one line? i.e. i tried using
=C(MATCH(A1, B:B,0)) to refer to Column C and Row 5 , but it doesn't work.
The INDIRECT function will do this for you.
To Test ...
Put the words "This is a test" in cell A1.
In cell A2, put the text "1"
In cell A3, put this formula ...
="A" & A2
Finally, in cell A4, add this formula ...
=INDIRECT(A3)
... that should then return the text within A1.
This demonstrates how it works so you should be able to apply it to your scenario. I suspect something like this will work for you?!? ...
="C" & (MATCH(A1, B:B,0))
... barring additional error checking of course.

Can't subtract text of one cell from another

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,"")

Excel formula to find reference used by other cell

Is there a way to find out the address of the cell being referenced in another cell in excel?
E.g. cell C1 contains formula =max(A:A) and returns a value of 10 which is actually referenced to cell A10. Can I use a formula in cell B that returns 'A10'?
And no, I don't want to use VBA at all.
Assuming that your entries are in Cells A1:A7, you can do it this way ...
In Cell B1, the formula =MAX(A1:A7) and
in Cell B2, the cell location of the maximum number in the range (shown in B1) is given by the formula
=CELL("address",INDEX(A1:A7,MATCH(MAX(A1:A7),A1:A7,0)))
OR
=ADDRESS(MATCH(MAX(A1:A7),$A$1:A7,0),1)
Mark as answer if it helps.
Managed to find the solution:
Similar to Kyle's formula, but instead we use match with multiple criteria to be more specific e.g.
=ADDRESS(MATCH(MAX(A1:A7)&"A",$A$1:A7&$B$1:$B$7,0),1)

Resources