+ Reply to Thread
Results 1 to 7 of 7

Calculate value based on another cell and vice versa

  1. #1
    Registered User
    Join Date
    10-15-2021
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    24

    Calculate value based on another cell and vice versa

    Hi everyone,
    I've run into a problem with a project i'm working on. I have column H = cost of item, I = sales price, J = earnings in percentage. What I'd like to do is autofill I or J based on the value of the other one. I've made a partial code, but i've hit a wall (I only do this on a hobby level). I also might be completely off base. Any input is greatly appreciated. Thank you.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Calculate value based on another cell and vice versa

    Do I understand you right that you want to calculate column I if you enter a value in Column H and calculate Column H if you enter a value in Column I? Never a need of Column J to be calculated?
    Experience trumps academics every day of the week and twice on Sunday.

  3. #3
    Registered User
    Join Date
    10-15-2021
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    24

    Re: Calculate value based on another cell and vice versa

    No, sorry if i didn't make it clear. H is what it'll cost me to buy an item. I want to calculate I based on an entered value in J and vice versa. In that way i can enter what i wish to sell it for (I) and i see the percentage earned from said item (J), or I can set how big an earning i want (J) and it'll give me the sales price (I). So H never need to be calculated since it's the price from the supplier. Thank you for your response.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Calculate value based on another cell and vice versa

    Try so.
    Change references as required.
    Code assumes you have headers in the top row.
    Column J is Formatted as percentage.
    Please Login or Register  to view this content.
    Last edited by jolivanes; 08-08-2022 at 04:06 PM.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Calculate value based on another cell and vice versa

    I have changed the code in Post #4. It also has some error trapping now.

  6. #6
    Registered User
    Join Date
    10-15-2021
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    24

    Re: Calculate value based on another cell and vice versa

    Perfect! Thank you so much!

  7. #7
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Calculate value based on another cell and vice versa

    This is one way to do it:

    Please Login or Register  to view this content.
    Last edited by beyond Excel; 08-11-2022 at 09:33 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA: convert cell data to column and vice versa
    By vikim in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-13-2019, 11:36 PM
  2. Replies: 6
    Last Post: 11-06-2017, 04:18 PM
  3. Set cell to formatted text of shape, and vice versa - is this possible?
    By dat444 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2016, 01:29 AM
  4. Replies: 1
    Last Post: 02-17-2016, 07:32 AM
  5. Enter and update ValuesIn Cell1 Based On Values In Cell 2 And Vice Versa.
    By miroper in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2010, 11:03 AM
  6. Page name from cell or vice versa
    By Audiguy82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2008, 06:21 PM
  7. [SOLVED] How do I reference a worksheet name in a cell, or vice versa?
    By ilmeaz in forum Excel General
    Replies: 3
    Last Post: 05-02-2005, 04:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1