Go Back  PPRuNe Forums > Misc. Forums > Computer/Internet Issues & Troubleshooting
Reload this Page >

Help with Excel spreadsheet please

Wikiposts
Search
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

Help with Excel spreadsheet please

Thread Tools
 
Search this Thread
 
Old 12th Jan 2007, 10:52
  #1 (permalink)  
Thread Starter
 
Join Date: Nov 2004
Location: Buckinghamshire
Posts: 84
Likes: 0
Received 0 Likes on 0 Posts
Help with Excel spreadsheet please

Hi all.
I'm in the process of putting together a spreadsheet for invoicing purposes, I have most of it place but I'm stuck on one bit. I need to know a function that will display an answer if for example:-

The amount in cell A8 is less than £1 then multiply it by 100%
The amount is between £1 and £5 then multiply it by 50%
The amount is between £5 and £50 then multiply it by 30%
The amount is between £50 and £99 then multiply it by 20%
Hoping there is an Excel expert reading this who can help me.
Thanks in advance for any advice

Bigwings
Bigwings is offline  
Old 12th Jan 2007, 11:08
  #2 (permalink)  
 
Join Date: Oct 2002
Location: Guernsey
Posts: 12
Likes: 0
Received 0 Likes on 0 Posts
The command you need is IF.

The basic format is =IF(AB=5,X,Y)

Translated this means IF Cell AB = 5 then Cell that this formula is in will be value X else it will be value Y.

To do want you want all you do is nest IF statements

so you would put in a cell where you want the answer
=IF(AB<1,AB*2,IF(AB<5,AB*1.5,IF(AB<50,AB*1.3,AB*1.2)))

Just be careful with the Brackets, as it's dead easy to get these mixed up, and always work in value order.
overcast is offline  
Old 12th Jan 2007, 11:13
  #3 (permalink)  
 
Join Date: May 2003
Location: UK
Posts: 154
Likes: 0
Received 0 Likes on 0 Posts
You could use a nested 'if' statement. This one checks a value but doesn't multiply it. You'll get the idea though. I havn't got time to write the one you need right now, but if you PM me, I'll do it tonight. This should get you started though.
=IF(D13>201,13,IF(D13>101,15,IF(D13>51,17.5,IF(D13>1,21," "))))
Bests
Giz

Edit...OOOppss...Overcast types quicker than Gizmo
gizmocat is offline  
Old 12th Jan 2007, 11:36
  #4 (permalink)  
Thread Starter
 
Join Date: Nov 2004
Location: Buckinghamshire
Posts: 84
Likes: 0
Received 0 Likes on 0 Posts
Thank for the quick replies guys, I'll give them a try.

Regards

Bigwings
Bigwings is offline  
Old 12th Jan 2007, 13:21
  #5 (permalink)  
 
Join Date: Mar 2003
Location: Aus
Posts: 192
Received 0 Likes on 0 Posts
If you are willing to dive into a bit of Visual basic try this
From Excel press Alt F11 to open the VBA editor
Rt click on your project and insert => Module
Paste this bit of code
Function markup(cost)
Select Case cost
Case Is < 1
markup = cost * 2
Case 1 To 5
markup = cost * 1.5
Case 5 To 50
markup = cost * 1.3
Case 50 To 99
markup = cost * 1.2
Case Else
markup = cost
End Select
End Function
Then all you need to type in the display field is =markup(xx) where xx is the cell you want the calc to work on.
I have assumed if >100 quid then no mark up (the Case else line)
Steep learning curve but VBA can make excel sing!
Agent86 is offline  
Old 12th Jan 2007, 13:59
  #6 (permalink)  
 
Join Date: Mar 2003
Location: England
Posts: 286
Likes: 0
Received 0 Likes on 0 Posts
BW,

The solution I would use is to create a table somewhere out of the way:

In this example I have used I3:I7 and J3:J7

In I3 enter 0
In I4 enter 1
In I5 enter 5
In I6 enter 50
In I7 enter 100

In J3 enter 2
In J4 enter 1.5
In J5 enter 1.3
In J6 enter 1.2
In J7 enter 1

Then in your target cell enter the formula:

=A8*INDEX(J3:J7,MATCH(A8,I3:I7,1),1)

EG
ExGrunt is offline  
Old 13th Jan 2007, 07:01
  #7 (permalink)  
Thread Starter
 
Join Date: Nov 2004
Location: Buckinghamshire
Posts: 84
Likes: 0
Received 0 Likes on 0 Posts
Agent86 and ExGrunt

Thanks for the suggestions, enough here to keep me happy for a few days.

Thanks again all

Bigwings
Bigwings is offline  
Old 13th Jan 2007, 11:27
  #8 (permalink)  
Per Ardua ad Astraeus
 
Join Date: Mar 2000
Location: UK
Posts: 18,579
Likes: 0
Received 0 Likes on 0 Posts
A query for bigwings/exgrunt - if I read the requirements ?as written?, should I3-I7 not be

0
1
5
50
99.01

and J3-J7 not be

1
.5
.3
.2
???
(as we do not know what happens over £99)

It all depends, of course, on what is meant by 'multiply' - the old conundrum!
BOAC is offline  
Old 13th Jan 2007, 12:38
  #9 (permalink)  
 
Join Date: Sep 2000
Location: France
Posts: 69
Likes: 0
Received 0 Likes on 0 Posts
Originally Posted by Bigwings
... I need to know a function ...
There's a little-known button in Excel labelled Help.

Search on function, maths functions, IF statements et al., and you'll get a plethora of examples. Very useful if trying to construct an auto-calculating plog as well.
matelot is offline  
Old 14th Jan 2007, 05:10
  #10 (permalink)  
Thread Starter
 
Join Date: Nov 2004
Location: Buckinghamshire
Posts: 84
Likes: 0
Received 0 Likes on 0 Posts
There's a little-known button in Excel labelled Help
Tried that before posting my question matelot but as I wasn't to sure of what I was looking for I thought I'd ask more knowledgeable people than me.

Thankfully some answered.

Bigwings
Bigwings is offline  
Old 15th Jan 2007, 07:36
  #11 (permalink)  
 
Join Date: Mar 2003
Location: England
Posts: 286
Likes: 0
Received 0 Likes on 0 Posts
@BOAC

As written you are probably correct that I7 should read 99 if you want 98.99 to be multiplied by 1.2 but 99.00 not to be multiplied. In using 100 I did make the heroic and possibly erroneous assumption that 99 included values up to 99.99 (and just for completeness because I assume we are working with money I am only quoting to 2 decimal places - the formula will actually work to the 15 decimal places to which excel calculates).

On your second query I read Bigwings original request 'multiply the amount by... as show the total rather than show the increase which is what using the decimals on their own would produce.

@Bigwing

Just a further thought that if you are going to copy my formula down a column then you need to use absolute references to the table ie:

=A8*INDEX($J$3:$J$7,MATCH(A8,$I$3:$I$7,1),1)

All the best

EG
ExGrunt is offline  
Old 15th Jan 2007, 09:26
  #12 (permalink)  
Per Ardua ad Astraeus
 
Join Date: Mar 2000
Location: UK
Posts: 18,579
Likes: 0
Received 0 Likes on 0 Posts
Absolutely! It is the old 'multiply by' question. Just thought I'd send bigwings a 'thought bubble'.
BOAC is offline  

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.