We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel Code Query

Cotta
Cotta Posts: 3,667 Forumite
Hi All,

The following code is functioning as required, however when the code meets the criteria it returns three different values "New Fee," "Source Fee" and "Old Fee" or otherwise it returns "Commission". Is there anyway to adjust this code so that instead of returning the variations of fee it simply returns "Fee"?

=IFERROR(VLOOKUP(F22,'[Fee Clients.xlsx]Sheet2'!$T:$AB,9,FALSE),"Commission")

Thanks
«1

Comments

  • maas
    maas Posts: 512 Forumite
    Part of the Furniture 100 Posts I've been Money Tipped!
    I dont have excel to test this out on but try

    =IF(IFERROR(VLOOKUP(F22,'[Fee Clients.xlsx]Sheet2'!$T:$AB,9,FALSE),"Commission"))="Commission","Commission","Fee")


    That's just wrapping an IF statement around it, they'll be better ways of doing it
  • Cotta
    Cotta Posts: 3,667 Forumite
    Thanks Mass but this brings up an error message.
  • maas
    maas Posts: 512 Forumite
    Part of the Furniture 100 Posts I've been Money Tipped!
    I think I had 1 extra bracket, try this

    =IF(IFERROR(VLOOKUP(F22,'[Fee Clients.xlsx]Sheet2'!$T:$AB,9,FALSE),"Commission")="Commission ","Commission","Fee")
  • Cotta
    Cotta Posts: 3,667 Forumite
    Excel corrects the code to the following, however this only returns a value of "FALSE" within all of the cells.

    =IFERROR(VLOOKUP(F3,'[Sector Fee Clients.xlsx]Sheet2'!$T:$AB,9,FALSE),"Commission")
  • maas
    maas Posts: 512 Forumite
    Part of the Furniture 100 Posts I've been Money Tipped!
    My final effort :(

    =IF(VLOOKUP(F22,'[Fee Clients.xlsx]Sheet2'!$T:$AB,9,FALSE),"Commission","Fee")
  • Cotta
    Cotta Posts: 3,667 Forumite
    maas wrote: »
    My final effort :(

    =IF(VLOOKUP(F22,'[Fee Clients.xlsx]Sheet2'!$T:$AB,9,FALSE),"Commission","Fee")

    That looks close, it's returning an #N/A, if an "IFERROR" statement can be included it would be sorted.
  • maas
    maas Posts: 512 Forumite
    Part of the Furniture 100 Posts I've been Money Tipped!
    Actually I havent given up yet. Im just curious why the IF statement doesnt work.

    In another cell on the spreadsheet type this

    =IF(D6="Commission","Commission","Fee")

    And replace D6 with the cell that the formula is in. Does this new cell give the desired outcome.
  • Cotta
    Cotta Posts: 3,667 Forumite
    maas wrote: »
    Actually I havent given up yet. Im just curious why the IF statement doesnt work.

    In another cell on the spreadsheet type this

    =IF(D6="Commission","Commission","Fee")

    And replace D6 with the cell that the formula is in. Does this new cell give the desired outcome.

    Perfect little workaround, thank you very much.
  • rmg1
    rmg1 Posts: 3,159 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Try this (untested):-
    =if(iserror(match(F22,'[Fee Clients.xlsx]Sheet2'!$T:$T,0)),"Commission","Fee")
    :wall: Flagellation, necrophilia and bestiality - Am I flogging a dead horse? :wall:

    Any posts are my opinion and only that. Please read at your own risk.
  • maas
    maas Posts: 512 Forumite
    Part of the Furniture 100 Posts I've been Money Tipped!
    We should be able to get that all inside 1 cell. Try rmg1's formula.

    If that doesnt work someone else should be able to get it all inside 1 cell.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 352.4K Banking & Borrowing
  • 253.7K Reduce Debt & Boost Income
  • 454.4K Spending & Discounts
  • 245.5K Work, Benefits & Business
  • 601.3K Mortgages, Homes & Bills
  • 177.6K Life & Family
  • 259.4K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.