nyyki: (Default)
[personal profile] nyyki
Okay, I'm trying to figure out If/Then functions in Excel, and since the syntax is different from what I learned back in my basic programming days I need a bit of help.

What I want to do is to determine something like this:
If B4>14 and B5>15 and B6>13 then multiply F2 by 1.1 else just return the value of F2. Anyone know how I would do this and make it work in Excel?

Date: 2009-06-08 03:18 am (UTC)
From: [identity profile] cyndtechgoddess.livejournal.com
You need to embed an AND function in your IF statement to make this work:

=IF((AND(B4>14,B5>15,B6>13)),F2*1.1,F2)

Checking the formula
I tried this using the value of 10 in cell F2. I then put 15, 20, and 25 in cells B4, B5 and B6 (respectively). The resulting value from the formula was 11 (10*1.1). When I changed one of the values in the range B4:B6 so it did not meet the criteria, I got the expected result of 10 (the value we have in F2).

Let me know if this helps. :)

You rock...

Date: 2009-06-08 03:36 am (UTC)
From: [identity profile] nyyki.livejournal.com
That did it. Worked like a charm. I'm learning so much about Excel. Now if I can just figure out how to use two values for a matrixB2 crossindexed with cell aB5 and return the value. (It's a table that has races across tthe top and intelligence scores across the side that returns a number of languages per racial type and intelligence score) I'm trying to automate most of the work for a first edition AD&D game, and Excel has made life much easier with things like Vlookup, but I still have a bit of information to go -- this matrix and learning how to do drop down boxes with presaved data in them. (for weapons so a typo doesn't FUBAR the population of the other cells from the vlookup table)I have a workaround, but I'd rather be able to say that use cell A3 crossindexed with

Re: You rock...

Date: 2009-06-08 04:00 pm (UTC)
From: [identity profile] amyboyd.livejournal.com
nyyki the Witch...You honestly amaze me! Programming in Excel and creating a game. That's so awesome.

Re: You rock...

Date: 2009-06-08 04:41 pm (UTC)
From: [identity profile] nyyki.livejournal.com
Well, not so much writing a game, as writing a game aid for a pencil and paper desktop game. Since I can't access the data by looking at a sheet of paper, I figured I'd just do this the way I do everything else -- digitally. This opened certain doors.

When we developed the RPG Artistry we had a combat resolution setup using Excel to look up data from tables and get them to drop the results into the front sheet of a workbook, so it is something that I've toyed with before. Excel is wonderful for making tables and form headers for documents (I never use table functions in Word, instead just building the form header in Excel and then copying it into Word) so I was comfortable keeping my data in a spreadsheet. And now that I'm enjoying a spate of visionlessness, (one I hope to get out of at some point) Excel makes it ever more handy because one cell contains one cell worth of data, while documents have data in lines that tend to make tables of info blur together. It's easier to just port things into Excel. So I'm using it a lot.
Page generated Jan. 17th, 2026 06:57 am
Powered by Dreamwidth Studios