+ Reply to Thread
Results 1 to 3 of 3

Having a field calculate based on two other fields, one word one number.

  1. #1
    Registered User
    Join Date
    10-15-2008
    Location
    West Des Moines, IA
    MS-Off Ver
    Excel 2007
    Posts
    40

    Having a field calculate based on two other fields, one word one number.

    So, premise:

    Column A has a number, currency 2 digits ($543.21 for example)
    Column B has an identifying word. Let's just say Apple, Banana, Carrot or Donut.

    In column C, I'd like to wrangle something like this:

    If B1 = Apple, then C1=A1*.02
    If B1 = Banana, then C1=A1*.03
    If B1 = Carrot, then C1=A1*.04
    If B1 = Donut, then C1=A1*.05

    Disclaimer: I'm completely useless with pivot tables, I've tried to learn them, it seems to be a blind spot in my brain, so let's try and avoid those if possible...

    If there's a way it could be done with added columns or extra hoops, I'm open to that, I just tried to state it in the most simplistic way I could think of. Any help would be appreciated!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,033

    Re: Having a field calculate based on two other fields, one word one number.

    =IF(B1="Apple",A1*0.02,IF(B1="Banana",A1*0.03,IF(B1="Carrot",A1*0.04,IF(B1="Donut",A1*0.05,""))))
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-15-2008
    Location
    West Des Moines, IA
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Having a field calculate based on two other fields, one word one number.

    Cool, just wanted to confirm how the commas & parenthesis panned out. Thanks!

+ 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. VBA code to calculate pivot fields to create calculated field programmatically
    By dougmcc1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-09-2015, 09:18 PM
  2. Replies: 3
    Last Post: 01-16-2014, 03:33 AM
  3. Replies: 3
    Last Post: 10-01-2012, 11:38 AM
  4. how do you update fields based on wording in another field w/o a formula in cell
    By juniperjacobs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2010, 09:17 AM
  5. Replies: 5
    Last Post: 08-05-2010, 01:40 PM
  6. How to add Boolean field based on other fields
    By m0use in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-22-2009, 01:14 PM
  7. Colouring fields by a word in the field?
    By g1ose in forum Excel General
    Replies: 3
    Last Post: 01-12-2005, 05:15 AM

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