Forum Discussion

espy325's avatar
espy325
Copper Contributor
Jul 10, 2023
Solved

Formula

Thank you so much for your helping,

 

my issue is I have 2 workbooks, 1 is read only and the second is where im trying to work.

 

In workbook 1 i have Amount due , I find amount due by using the address function. For the sake of explaining Ill be calling my address variable X. Now I need to subtract by the amount paid to get the total owed. the issue is I cant seem to figure out a way of use my variable X to subtract.

 

=AMOUNT PAID-'NOOTBOOK1'!X

 

How do i make varaible x been seen as the address of the number and not just X?

  • Hi espy325,

     

    to use a variable as the address of a cell in a formula, you can use  the INDIRECT function. 

    Here's an example of how you can adjust your formula using INDIRECT:

    =AMOUNT PAID - INDIRECT("'NOOTBOOK1'!" & X)

    The INDIRECT function converts the text in X into a cell reference and retrieves the value of the cell referenced by X.

    You need to replace the workbook name and sheet name in the formula with the actual names in your environment. Additionally, verify that the cell reference stored in X follows the correct format (e.g., "A1", "B5", etc.).


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    Kindest regards

    Leon Pavesic

  • LeonPavesic's avatar
    LeonPavesic
    Silver Contributor

    Hi espy325,

     

    to use a variable as the address of a cell in a formula, you can use  the INDIRECT function. 

    Here's an example of how you can adjust your formula using INDIRECT:

    =AMOUNT PAID - INDIRECT("'NOOTBOOK1'!" & X)

    The INDIRECT function converts the text in X into a cell reference and retrieves the value of the cell referenced by X.

    You need to replace the workbook name and sheet name in the formula with the actual names in your environment. Additionally, verify that the cell reference stored in X follows the correct format (e.g., "A1", "B5", etc.).


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    Kindest regards

    Leon Pavesic

Resources