+ Reply to Thread
Results 1 to 8 of 8

Formula to generate a value

  1. #1
    Registered User
    Join Date
    11-24-2020
    Location
    Bethlehem, PA
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    11

    Formula to generate a value

    I have a workbook with two sheets. One called "County Info" and one called "Values". On the Values sheet is a table similar to below.

    XLS screenshot.JPG

    On the County Info Sheet, the corresponding columns for this information is:
    Type = EC
    Zip Code = AF
    Acreage = EH

    I need a formula in a column on the County Info sheet that will look at the values in Type (EC), Zip Code (AF), and Acreage (EH), return the appropriate corresponding Value from the table on the Values sheet, and then multiply that value times the Acreage (EH). For example:

    If Type is Commercial, Zip Code is 12345, and Acreage is 2, the result of the formula would be 40000
    If Type is Residential, Zip Code is 67890, and Acreage is 10, the result of the formula would be 10000

    This formula would need to be copied down thousands of rows. Thanks in advance!
    Attached Files Attached Files
    Last edited by jeffamore; 03-03-2021 at 02:55 PM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,108

    Re: Formula to generate a value

    it would be better to upload a sample sheet with expected results - SEE the yellow banner at top of thread

    In your example , you have 2 commercial with 2 entries for the same Zipcode , BUT with different acres and value

    A lookup index/match should be able to do that

    you have the same zip code and type, not sure how you know which one to use - i suspect a sample sheet with explanation of example results would help a lot
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    11-24-2020
    Location
    Bethlehem, PA
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    11

    Re: Formula to generate a value

    Thanks.... I've attached a quick sample with the results I would expect. The value is based on the matching type, zip code and acreage. Between 0 and 5 acres would pull the Value in the row with the 0 in Acreage. Anything >= 5 acres would pull the value in the row with 5 in the acreage. Hopefully that makes sense.

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,108

    Re: Formula to generate a value

    this will return the Value
    =INDEX(Value!$D$1:$D$200,MATCH(B2&C2&IF(D2<5,0,5),Value!$A$1:$A$200&Value!$B$1:$B$200&Value!$C$1:C200,0)) - Which I have put in column H, not use in result - BUT just to show the result of the lookup for you to check

    Then multiply by the Acres
    Which i have put in E
    =INDEX(Value!$D$1:$D$200,MATCH(B2&C2&IF(D2<5,0,5),Value!$A$1:$A$200&Value!$B$1:$B$200&Value!$C$1:C200,0))*D2
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-24-2020
    Location
    Bethlehem, PA
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    11

    Re: Formula to generate a value

    That looks correct to me! I'm assuming the '200' in your formula is just to define the number of rows? So if I had 1000 rows, that would be 1000. Is that right?

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,108

    Re: Formula to generate a value

    correct, sorry, i should have mentioned that

  7. #7
    Registered User
    Join Date
    11-24-2020
    Location
    Bethlehem, PA
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    11

    Re: Formula to generate a value

    Awesome... I'm going to give it a try. Thank you!

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,108

    Re: Formula to generate a value

    you are welcome

+ 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. [SOLVED] formula to generate a string
    By lightframe109 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-08-2019, 03:09 PM
  2. Replies: 1
    Last Post: 02-16-2016, 07:51 PM
  3. [SOLVED] using formula to generate values
    By penfold1992 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 10-24-2012, 07:21 AM
  4. [SOLVED] Need formula to generate sequence
    By singhabhijitkumar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-24-2012, 03:46 AM
  5. Help needed to generate a “best of 3” formula
    By MikeMadMonk in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 12-02-2006, 10:17 AM
  6. generate a random number and use if function to generate new data
    By Dogdoc1142 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2006, 10:50 PM
  7. Replies: 1
    Last Post: 07-20-2005, 11:05 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