+ Reply to Thread
Results 1 to 15 of 15

Creating a formula to look up values

  1. #1
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Question Creating a formula to look up values

    Hi,

    In my spreadsheet all the cells in column A contain the name of an inventory item and the unique inventory code number for that item. The inventory code number ranges from 0001 to 9999.

    I am trying to create a formula that performs the following operation:

    IF CELL A1 contains 0001 then divide cell B1 by x, IF CELL A1 contains 0002 then divide cell B1 by y, IF CELL A1 contains 0003 then divide cell B1 by z and so on all the way up to 9999.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Creating a formula to look up values

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Re: Creating a formula to look up values

    I have provided an example of what I am trying to achieve in Cell X7.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Creating a formula to look up values

    I created a lookup table in Z2:AA5 contain Code and its factor


    in X7

    =IFERROR(W7/INDEX($AA$1:$AA$5,(SUMPRODUCT(ISNUMBER(SEARCH($Z$2:$Z$5,A7))*ROW($Z$2:$Z$5)))),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Copy down
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Re: Creating a formula to look up values

    Thank you for your prompt reply. The formula you provided does exactly what I needed. I do have some follow up questions however I would like a few days to experiment with the formula first.

  6. #6
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Re: Creating a formula to look up values

    Could you provide a formula that satisfies the condition described in cell Y7 of the attached worksheet?
    Attached Files Attached Files

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Creating a formula to look up values

    Might this satisfy your Y7 conditions...

    =IF(X7<>"",IF(X7<0,0,IF(X7>=0,ROUNDUP(X7,0))),"")
    HTH
    Regards, Jeff

  8. #8
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Re: Creating a formula to look up values

    Thank you. The formula you provided does what was required.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,193

    Re: Creating a formula to look up values

    Beaten to it!

  10. #10
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Re: Creating a formula to look up values

    Thank you John. The formula you provided works.

  11. #11
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Creating a formula to look up values

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  12. #12
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Re: Creating a formula to look up values

    I have one further question. Should I post here or start a new thread?

  13. #13
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Re: Creating a formula to look up values

    Every week I generate a consolidated inventory report which is formatted as displayed in the attachment with file name "datasourceformat.xls". Is it possible to create a worksheet that I can direct to source the data from the current weeks consolidated inventory report to generate the data in column A and column Y in the attached file ConsolidatedInventoryUsage-1.xlsx?
    Attached Files Attached Files

  14. #14
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Creating a formula to look up values

    Sounds like a totally different question, so please close this thread as solved and start a new one. Thanks!

  15. #15
    Registered User
    Join Date
    06-01-2017
    Location
    Sydney, Australia
    MS-Off Ver
    Office for Mac - 2011
    Posts
    69

    Re: Creating a formula to look up values

    Ok. Thank you.

+ 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] Help Creating A Formula That Matches Values
    By artiststevens in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-22-2017, 06:30 AM
  2. [SOLVED] Creating a formula for cell recognition and sum values?
    By JohnboyKGS in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-22-2015, 05:14 PM
  3. [SOLVED] Help creating a formula to add values that meet criteria
    By wrivera8843 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-19-2013, 12:38 PM
  4. Creating formula using multiple Data Validation values
    By MichaelH2912 in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 08-13-2013, 11:00 AM
  5. [SOLVED] Creating an IF formula with SUM using set values and variable values
    By rjordine in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-26-2013, 01:05 AM
  6. Creating a formula to rank values on a scale of 1-5
    By kiellew in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-05-2012, 09:04 PM
  7. How to remove formula from creating duplicate values?
    By Climaxgp in forum Excel General
    Replies: 3
    Last Post: 12-14-2009, 03:04 AM

Tags for this Thread

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