Excel Change formula depends on a text field

Posted on 2014-08-28
Last Modified: 2014-08-28
Dear experts.

for example i've in Cell C20 3 different texts like  FUL, GUL, DUL and i want to change 2 Formulas in C21 and C22
depends on the TEXT in Cell C20

The first formula in C21 would be for "FUL"
="enable-mailbox -identity "&C3&" -Alias "&C3&"

and for "GUL"
="enable-mailbox -identity "&C3&" -Alias "&C3&" -database DBGUL1

and for "DUL"
="enable-mailbox -identity "&C3&" -Alias "&C3&" -database DBDUL1
Question by:Mandy_
    LVL 10

    Accepted Solution

    If I understand correctly, depending on the value of C20 you want to display the relevant text.  You can do this using IF statements as detailed below:
    =IF(C20="FUL","enable-mailbox -identity "&C3&" -Alias "&C3,IF(C20="GUL","enable-mailbox -identity "&C3&" -Alias "&C3&" -database DBGUL1",IF(C20="DUL","enable-mailbox -identity "&C3&" -Alias "&C3&" -database DBDUL1 ",FALSE)))

    Open in new window

    Hope this helps.
    LVL 2

    Author Closing Comment

    Yep, thats it. thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Title # Comments Views Activity
    offset an array formula 4 23
    copying from excel to word 2 28
    Adding Data To Master File From Import Final 9 19
    Check version 13 42
    Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
    This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now