+ Reply to Thread
Results 1 to 9 of 9

Key word formula and do some maths :)

Hybrid View

  1. #1
    Registered User
    Join Date
    01-20-2014
    Location
    Madison WI
    MS-Off Ver
    Excel 2013
    Posts
    15

    Key word formula and do some maths :)

    Hey, just wondering is there a formula that allows you to search a column for a particular word and then from that have it divide a numbe rin another column by 2 or 3 depending on the word?

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,414

    Re: Key word formula and do some maths :)

    So are you saying that if it finds the word in cell B12, say, the formula would then take the number from A12 (i.e. corresponding row) and divide it by 2 or 3? Is this for every cell in the range? Is the word a variable (i.e. in some other cell) or fixed?

    Please supply further details.

    Pete

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Key word formula and do some maths :)

    You can use Vlookup for the main part of it..

    =VLOOKUP("particular word",A:B,2,FALSE)/2

    It searches column A for a particular word, and returns the corresponding value from column B (another column)
    Then devides by 2

    You'll need to provide some more information on how to choose deviding by 2 or 3 depending on the word..
    How exactly should we choose to devide by 2 or 3 ?

  4. #4
    Registered User
    Join Date
    01-20-2014
    Location
    Madison WI
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Key word formula and do some maths :)

    Basically, I have list of words in Column H that are consist of the following (A, A/B, A/B/C)/ Depending on what the word is I want it to divide a cell in P by 1,2 or 3. For example, it searches H12 and finds A/B, it then divides the number in P12 by 2 in the line row underneath the number. I dont mind manually putting in the rows but I have a giant list and it will take me a week to divide everything.


    Thanks so much for your help

    Sean

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Key word formula and do some maths :)

    Sorry, that description didn't help at all.
    Still don't understand why it's devided by 2 instead of 1 or 3

    Can you post a sample book?

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,650

    Re: Key word formula and do some maths :)

    Maybe:
    P13=P12/(LEN(H12&"/")-LEN(SUBSTITUTE(H12&"/","/","")))
    Quang PT

  7. #7
    Registered User
    Join Date
    01-20-2014
    Location
    Madison WI
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Key word formula and do some maths :)

    Book1.xlsxSorry, I honestly am clueless when it comes to excel.

    Ok in the example below I have to divide the cost in col, J, by whatever amount of items are in col. F. So in row 2 I have one laptop so, that cost will stay as normal. In row 3 I have 3 items so I need to divide the cost (col. J) by 3. Ideally I would love a macro to insert rows under neath the rows that have more than 2 item and then do the maths in that row under the cost column but I dont think it is possible. The same idea would work for 2 items.

    Again sorry for all the confusion and if this is not possible than I will just do it manually. ( Looking for an easy way out

    Thanks

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Key word formula and do some maths :)

    Try

    =J2/(LEN(F2)-LEN(SUBSTITUTE(F2,"/",""))+1)

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,414

    Re: Key word formula and do some maths :)

    It doesn't help that you keep changing the cell references, and the layout of the data - at first you were asking for the result to be in the row below where the data is. It's also a very strange logic that you are applying - the average cost per item. So if you bought a laptop and a separate mouse, you would average the cost for both items?

    Pete

+ 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. Understanding the maths in seasonal analysis formula
    By Kolacube in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-03-2013, 11:08 PM
  2. forecast using maths formula
    By okl in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-25-2013, 01:01 AM
  3. Using formula to answer a maths question?
    By simbalyon303 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-15-2013, 08:41 AM
  4. More of a Maths question!!
    By Icehockey44 in forum Excel General
    Replies: 1
    Last Post: 11-28-2011, 06:28 AM
  5. help: Maths and formula help
    By legion in forum Excel General
    Replies: 5
    Last Post: 03-29-2009, 07:43 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