Consulting

Results 1 to 9 of 9

Thread: Replace formula

  1. #1

    Replace formula

    Hello,

    How can I replace this formula?
    =IF(B14<5,0,IF(B14<10,5%,IF(B14<12,6%,IF(B14<15,7%,IF(B14>=15,10%)))))

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Select the cell the formula is in and type something else.

    That's a true and complete answer to your exact question.











    IOW, We need more information.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Sep 2013
    Posts
    8
    Location
    iterate thru the rows looking for that formula using VBA....

    if sheets(0).Cells(0,0).Formula = "=IF(B14<5,0,IF(B14<10,5%,IF(B14<12,6%,IF(B14<15,7%,IF(B14>=15,10%))))) " then
    sheets(0).Cells(0,0).Formula = "new formula goes here"
    end if

  4. #4
    VBAX Regular
    Joined
    Feb 2009
    Posts
    9
    Location
    Try:
    =LOOKUP(B14,{4,9,11,14,15;0,5,6,7,10})

  5. #5
    VBAX Regular
    Joined
    Sep 2013
    Posts
    8
    Location
    it really depends on what you are trying to lookup -and how - and how large your dataset is

  6. #6
    Quote Originally Posted by SamT View Post
    Select the cell the formula is in and type something else.

    That's a true and complete answer to your exact question.
    Very clever. I was interested in a formula equivalent to the one I wrote.

    Thanks to all.

  7. #7
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    you may adopt the formula posted by amontes;
    =LOOKUP(B14,{0,5,10,12,15;0,0.05,0.06,0.07,0.1})
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  8. #8
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Glad you liked it. I wasn't sure you would see the humor.

    I was interested in a formula equivalent to the one I wrote.
    Thank you, that's what we need
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  9. #9
    Thank mancubus and amontes.

Posting Permissions

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