473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Excel Formula

47
Hello,

I am not good with Excel and I would truly appreciate assistance with the following:

Please let me know how I can place all of this in one field, let’s say AN100.

If U100 (column U, value in row 100) is smaller than AJ100 than AN100 should be =D100*1
If U100 is smaller than AJ100 and AK100 than AN100 should be =0
If U100 is bigger than AL100 than AN100 should be =D100*3
If U100 is bigger than AL100 and AM100 than AN100 should be =D100*4
If U100 is bigger than AJ100 and AK100, but smaller than AL100 and AM100 cell AN100 should be =D100*2

How can I squeeze all of this into field AN100?

(Is there any way to make Excel colour AN cells in different colours, subject to which of the conditions above are met?)


Also, I need assistance with the following as well:

If U100 (column U, value in row 100) is smaller than AJ100 than AO100 should have value 1
If U100 is smaller than AJ100 and AK100 than AO100 should have value 0
If U100 is bigger than AL100 than AO100 should have value 3
If U100 is bigger than AL100 and AM100 than AO100 should have value 4
If U100 is bigger than AJ100 and AK100, but smaller than AL100 and AM100 cell AO100 should have value 2


Thank you in advance!
Feb 25 '09 #1
50 4907
NeoPa
32,556 Expert Mod 16PB
Is there any known order of the various values?
EG. AJ always greater than AK.
Feb 25 '09 #2
bcr123
47
Hello NeoPa.

AJ is always greater than AK.
AL is always smaller than AM.

Thank you!
Feb 25 '09 #3
NeoPa
32,556 Expert Mod 16PB
Can AM ever be smaller than AK?
Can AL ever be smaller than AJ?
Feb 25 '09 #4
bcr123
47
Hello.
Thank you very much.

AM can't be smaller than AK.
AL can't be smaller than AJ.
Feb 25 '09 #5
NeoPa
32,556 Expert Mod 16PB
OK.

To save asking all the questions in detail, it may be a better idea just to look at the question in post #2 again and specify the exact known relation between AJ, AK, AL & AM. I presume there's a smallest to largest progression, but still have no idea if any values can be equal to the next one up or down.

I just need a full answer to this question if you can (in one place and clearly laid out).
Feb 25 '09 #6
bcr123
47
Hello NeoPa!

Thank you for your time.

Please note that
AJ = Mean minus Standard deviation
AK = Mean minus Standard deviation x 2
AL = Mean plus Standard deviation
AM = Mean plus Standard deviation x 2

Thank you.
Feb 26 '09 #7
bcr123
47
All values in columns AJ, AK, AL & AM increased from first value and than decreased over time - as mean and standard deviation are changing.

Thank you.
Feb 26 '09 #8
NeoPa
32,556 Expert Mod 16PB
OK. Nearly there.
  1. Is it always true that [AJ]=0-[AL]?
  2. Is it possible for either [AJ] or [AL] to have a value of 0?
If the answer to 2 is Yes then it's also possible that [AJ]=[AK]=[AL]=[AM]=0.

PS. Until I hear back from you I'll look to preparing a formula based on the answers both being Yes.
Feb 26 '09 #9
NeoPa
32,556 Expert Mod 16PB
Try this in AN100 :
Expand|Select|Wrap|Line Numbers
  1. =$D100*IF($U100<$AK100,0,IF($U100<$AJ100,1,IF($U100<$AL100,2,IF($U100<$AM100,3,4))))
This is designed to be dragable (down, or up, the column).
Feb 26 '09 #10
NeoPa
32,556 Expert Mod 16PB
Forget that. Instead put in AO100 :
Expand|Select|Wrap|Line Numbers
  1. =IF($U100<$AK100,0,IF($U100<$AJ100,1,IF($U100<$AL100,2,IF($U100<$AM100,3,4))))
Then put in AN100 simply :
Expand|Select|Wrap|Line Numbers
  1. =$D100*$AO100
Feb 26 '09 #11
bcr123
47
Hello NeoPa!

Your help is truly appreciated - Thank you!

[AH] - [AI] = [AJ]
[AH] + [AI] = [AL]

I don't know math that well, but I think that AJ & AL can be 0.

I have data values in column U and [AH] is average value of U after every single event, while [AI] is Standard deviations of U after every single event.
Feb 26 '09 #12
NeoPa
32,556 Expert Mod 16PB
@bcr123
I'm not sure about AN, but AO should certainly work with Conditional Formatting (from the Format menu). You may find a way to specify a condition for AN too. Have a look.
Feb 26 '09 #13
bcr123
47
Thank you.
Will come back to confirm if it works or not.

Thank you, once again!
Feb 26 '09 #14
bcr123
47
Thank you NeoPa.

Works great.

Will sit and work it properly tonight/tomorrow and will let you know is everything is ok

Thank you!
Feb 26 '09 #15
NeoPa
32,556 Expert Mod 16PB
You're welcome :)

Good luck with your project.
Feb 26 '09 #16
bcr123
47
Thank you, once again.

May I ask you here something else, that is not 100% related to formula issue that you have helped me with - Or proper way would be to post under new subject?
Feb 26 '09 #17
NeoPa
32,556 Expert Mod 16PB
Post a separate thread if you would, but if you let me know in here that it's been posted (a link would be a bonus but I can find it anyway if not), then I'll check it out for you and respond.
Feb 26 '09 #18
bcr123
47
Hello NeoPa,

Please let me know if there is way to get more than 3 conditional formatting that I am trying to use in my AO column.

I need 4 or 5 colors, while conditional formatting is allowing me to use no more than 3.

Thank you, as always, for your time and help!
Feb 27 '09 #20
bcr123
47
Also, is there a way to make, as an example, cell AN100 to have width of 2cm, while cell AN110 remains 3cm?

Thank you!
Feb 27 '09 #21
bcr123
47
Sorry, there is one more question related to formulas that you have helped me with:

If I want to drag formulas down AN column, but if I need them in every other row (AN 5, AN 7, etc.) - what is the best way to do it in order to avoid copy/pasting formulas in rows where I shouldn't have them (AN6, AN8, etc.).

Thank you very much!
Feb 27 '09 #22
bcr123
47
Hello NeoPa - There is one more question.

This is adjusted formula (it is in column AA now) to what you have made for me:

=IF($L23<$P23,0,IF($L23<$Q23,1,IF($L23<$R23,2,IF($ L23<$S23,3,4))))

Please let me know what I need to to add the following:

Same rules, same data, just one more condition is that same formula has to be confirmed in rows V, W, X, Y with M being what is L above and V, W, X & Y being what P, Q, R and S are in formula above.

Thank you very much for your time!
Feb 27 '09 #23
bcr123
47
Just to clarify:

Cell AA23 has to have value 0 if L23 is smaller than P23 and M23 is smaller than V23 and same rule applies for value 2, 3, 4 & 0 in AA23.

Just to make sure I am clear with explanation - I somehow have to add AND to formula you made for me and make sure same conditions are met for value in M23.

Thank you very much!
Feb 27 '09 #24
NeoPa
32,556 Expert Mod 16PB
@bcr123
I don't think there is I'm afraid.

You can define a catch-all, then three conditional formats, but that only gets you to 4.

You could do it in the Change event in VBA of course. If that doesn't frighten you.
Feb 27 '09 #25
NeoPa
32,556 Expert Mod 16PB
@bcr123
The only way I can think of having a similar effect at least, is to merge cells in some rows but not others. It means using AO for the data and shifting everything one to the right.

Even this leaves subsequent columns as columns. This is also a very fiddly and complicated concept to implement.
Feb 27 '09 #26
NeoPa
32,556 Expert Mod 16PB
@bcr123
Paste the formulas into the cells individually (You can select individually and paste into the selection.), or implement it in VBA.

Working at a row or column level is convenient obviously, but it can only work if what you are doing relates to the whole row or column.
Feb 27 '09 #27
bcr123
47
Thank you NeoPa!

Please let me know if can help me with my posts from today 0 10:16 & 10:18.

Thank you for your 10:59, 11:23 & 11:30 posts – Will try to learn about VBA and until than will color required cells manually and will paste into every other row manually.

Thank you very much for help me!
Feb 27 '09 #28
NeoPa
32,556 Expert Mod 16PB
@bcr123
I think you may need to take another look at post #11. This formula is not an accurate representation of the logic in there, even assuming columns have moved.
Feb 27 '09 #29
NeoPa
32,556 Expert Mod 16PB
@bcr123
I'm afraid I can't (other than my last post). I don't follow what you're asking as the terms used are too unclear.

I suggest you try again to explain it, being very clear about what is referencing what.
Feb 27 '09 #30
bcr123
47
@NeoPa
Hello and apologies for the confusion.

Original formula was:

IF($U100<$AK100,0,IF($U100<$AJ100,1,IF($U100<$AL10 0,2,IF($U100<$AM100,3,4))))

If U100 is smaller than AK100, than 0 is going as value in AA100, etc.

I now have another problem that I don't know how to sort:

If U100 is smaller than AK100 and and if M100 is smaller than W100 , than 0 is going as value in AA100.

If U100 is smaller than AJ100 and if M100 is smaller than V100 than 1 is going as value in AA100.

If U100 is smaller than AL100 and if M100 is smaller than X100 than 2 is going as value in AA100.

If U100 is smaller than AM and if M100 is smaller than Y100 than 3 is going as value in AA100.

If U100 is bigger than AM100 and if M100 is bigger than Y100 than 4 is going as value in AA100.

Thank you for your time and I apologize for the confusion.
Feb 27 '09 #31
NeoPa
32,556 Expert Mod 16PB
I don't know if this is clear to you, but you've left out great chunks of the logic here.

What if (for instance) U100<AK100, but M100>=W100?
Feb 27 '09 #32
bcr123
47
Can't attach PNG photo of portion of spreasheet.
Feb 27 '09 #33
bcr123
47
Could you please tell me how I can attach PNG form my PC - it is screen shot of my Excel and would like to post it and list all rules under it.

Thank you!
Feb 27 '09 #34
NeoPa
32,556 Expert Mod 16PB
In the reply or advanced edit screen, there is a button, Manage Attachments (you may need to scroll down), that enables you to add attachments.

NB. There are some size limits to conform to.
Feb 27 '09 #35
bcr123
47
Here is a list of all rules.

I've tried to attach PNG file, but no luck.

Thank you for your time and help!

All rules are IF rules:

U100<AK100 and if M100<W100, then AA100 vlaue is 0

U100<AJ100 and if M100<V100, then AA100 vlaue is 1

U100<AL100 and if M100<X100, then AA100 vlaue is 2

U100<AM100 and if M100<Y100, then AA100 vlaue is 3

U100>AM100 and if M100>Y100 then AA100 vlaue is 4

Always:
AK<AJ<AL<AM
W<V<X<Y
U is related to AK, AJ, AL, AM
M is related to W, V, X, Y

If U100<AK100 and if M100<V100 (but M100>W100) then AA100 value is 1
If U100<AK100 and if M<X100 (but M100>V100) then AA100 value is 2
If U 100<AK100 and if M<Y100 (but M100>X100) then AA100 value is 2
If U 100<AK100 and if M>Y100 then AA100 value is 2

If U100<AJ100 and if M<W100 then AA100 value is 1
If U100<AJ100 and if M<X100 (but M100>V100) then AA100 value is 2
If U 100<AJ100 and if M<Y100 (but M100>X100) then AA100 value is 2
If U 100<AJ100 and if M>Y100 then AA100 value is 2

If U100>AL100 and if M>Y100 then AA100 value is 3
If U100>AL100 and if M<X100 (but M100>V100) then AA100 value is 2
If U100>AL100 and if M<V100 (but M100>W100) then AA100 value is 2
If U100>AL100 and if M<W100 then AA100 value is 2

If U100>AM100 and if M<Y100 (but M100>X100) then A100 value is 3
If U100>AM100 and if M<X100 (but M100>V100) then A100 value is 2
If U100>AM100 and if M<V100 (but M100>W100) then A100 value is 2
If U100>AM100 and if M<W100 then A100 value is 2

If AL100>U100>AJ100 AA100 value is 2 irrespective of M
If X100>M100>V100 AA100 value is 2 irrespective of U

Thank you!
Feb 27 '09 #36
NeoPa
32,556 Expert Mod 16PB
This looks a little complicated to rush through now, but I notice there seems to be a lot more clear info here than in previous occasions so I'll look at it over the weekend and see what I can come up with.
Feb 27 '09 #37
bcr123
47
Thank you very much NeoPa.

Attached is PNG file as snapshot of spreadsheet.

U from previous post may be substituted with L; AK with Q; AJ with P; AL with R and AM with S.

Whole idea is:

-When, both, U (L) and M are under -2 Standard deviations, value for AA is 0;
-When either U (L) or M is under -2 Stdev and another one is under -1 Stdev the value for AA is 1;
-When, both, U (L) and M are under -1 Standard deviations, value for AA is 1;
-When either U (L) or M is under -2 Stdev and another one is above -1 Stdev or above +1 Stdev or above +2 Stdev than AA is 2;
-When either U (L) or M is under -1 Stdev and another one is above -1 Stdev or above +1 Stdev or above +2 Stdev than AA is 2;


-When, both, U (L) and M are under +1 Stdev, but above -1 Stdev value for AA is 2;

-When, both, U (L) and M are above +2 Standard deviations, value for AA is 4;
-When, either U (L) or M is above +2 Stdev and another one is above +1 Stdev value for AA is 3;
-When, both, U (L) and M are above +1 Standard deviations, value for AA is 3;
-When, either U (L) or M is above +2 Stdev and another one is below +1 Stdev, -1 Stdev or -2; Stdev, then AA value is 2.
-When, either U (L) or M is above +1 Stdev and another one is below +1 Stdev, -1 Stdev or -2; Stdev, then AA value is 2.

Standard deviations related to column L are in blue (P-S) and Standard deviations related to column M are in green (V-Y).

Example, selected row :

AA value in that row should be 2 - L is smaller than R (+1 Stdev is 12.11) but bigger than P (-1 Stdev is 11.04), so despite M is larger than X (+1 Stdev is 993.25), AA remains 2, because only M is above +1 Stdev, while L remains below + 1 Stdev.

Thank you, once again, for your time.

Have a pleasant evening and weekend!
Attached Files
File Type: zip 1234.zip (19.0 KB, 89 views)
Feb 27 '09 #38
NeoPa
32,556 Expert Mod 16PB
Starting at line 2 (change if necessary) :
Expand|Select|Wrap|Line Numbers
  1. =IF(AND($L2<$Q2,$M2<$W2),0,IF(AND($L2<$P2,$M2<$V2),1,IF(AND($L2<$S2,$M2<$Y2),4,IF(AND($L2<$R2,$M2<$X2),3,2))))
Mar 2 '09 #39
NeoPa
32,556 Expert Mod 16PB
It's necessarily more complicated, but I resolved you explanation down to the following to produce this :
Expand|Select|Wrap|Line Numbers
  1. Step                    Value
  2. Order  Logic           Returned
  3.  A     U < -2 AND
  4.        M < -2             0
  5.  B     NOT Step A AND
  6.        U < -1 AND
  7.        M < -1             1
  8.  C     U >  2 AND
  9.        M >  2             4
  10.  D     NOT Step C AND
  11.        U >  1 AND
  12.        M >  1             3
  13.  E     Anything else      2
Mar 2 '09 #40
bcr123
47
Thank you NeoPa - Your time and assistance are truly appreciated.

Please note that there are several other possibilities:

U <-2 AND M<-1 (but not <-2) should return 1
U <-1 (but not <-2) AND M<-1 should return 1


U >2 and M >1 (but not >2) should return 3
U >1 (but not >2) and M>2 should return 3

Thank you, once again!
Mar 2 '09 #41
NeoPa
32,556 Expert Mod 16PB
I think you'll find (unless it's possible in your scenario for something to be less than -2 but not being less than -1) that these possibilities are indeed covered by steps B & D respectively.

If you can find any situation where it doesn't work for you, please post the details and I'll look at it again for you.
Mar 2 '09 #42
bcr123
47
Hello NeoPa,

Thank you for your time.

Please review attached files when you have a moment:

File 1.png –
In highlighted line AA should have value 3, as L26>R26 (but L26<S26)
AND
M26>X26 (but M26<Y26)
--------------------------
File 2.png –

AA should have value 4, as L48>S48
AND
M48>Y48
--------------------------
File 3.png –

AA should have value 3, as L86>R86 (but L86<S86)
AND
M86>X86

Thank you very much – you are great contributor to this forum and I am grateful for your time and help.

(Please note that I have reorganized Excel, so these 2 calculations are next to each other, so I can post it nicely. I just have replaced U with L in your original formula and I’ve adjusted row number as well.)
Attached Files
File Type: zip NeoPa.zip (93.3 KB, 80 views)
Mar 2 '09 #43
NeoPa
32,556 Expert Mod 16PB
I changed the earlier one to use $L instead of $U, but that wasn't the problem. I forgot to use > instead of < for the 4 & 3 results. Try this new fixed version :
Expand|Select|Wrap|Line Numbers
  1. =IF(AND($L2<$Q2,$M2<$W2),0,IF(AND($L2<$P2,$M2<$V2),1,IF(AND($L2>$S2,$M2>$Y2),4,IF(AND($L2>$R2,$M2>$X2),3,2))))
Mar 3 '09 #44
NeoPa
32,556 Expert Mod 16PB
This question's been bugging me for a while now, and looking at your data nicely laid out like that it's even more of a curiosity for me now :

Why do you list STDV (-1) before STDV (-2)?
Mar 3 '09 #45
bcr123
47
Thank you NeoPa!

Your help is appreciated.

I've copied formula into Excel and will post later in the evening or tomorrow if it is working ok - I believe it will and I am grateful for your time and all the help.

Thank you!
Mar 3 '09 #46
bcr123
47
@NeoPa
Very strange for me as well.
I've noticed it and it's been lying there and staring at me.
I'm confused about it as well and will re-organize Excel again once all is done with formulas, etc.

:)

Thank you, once again!
Mar 3 '09 #47
NeoPa
32,556 Expert Mod 16PB
@bcr123
I have to say it's been a pleasure working with someone as well mannered as you.
Mar 3 '09 #48
bcr123
47
To reciprocate with the compliment –

It is very unusual for newbie to find so much help and patience from senior forum member(s) on any forum and I am truly grateful for your time, patience and help.

So far, my experience with bytes.com has been very positive and in few short days I’ve learned a lot and I will keep on visiting these pages in order to read and learn.

Will let you know later in the evening or tomorrow how formula is performing.

Thank you NeoPa!
Mar 3 '09 #49
bcr123
47
Thank you NeoPa!

Formula is working great!

Thank you very much for your time.
Mar 4 '09 #50

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Niyazi | last post by:
Hi, I have to retrieve a data from AS400 DB2 and after working with data I have to export into one of existing Excel file. I can connect into specific library in AS400 DB2 using AS400...
3
by: Carlos Magalhaes | last post by:
Hey All, I am doing some excel automation using the excel COM. I can do most of the functions and its working well until I come across a formula. I can run a formula and insert the formula...
6
by: Rich Wallace | last post by:
Hi all, I have a VB app that runs and manages individual XLS files within a single COM object. Upon processing the final fie, I attempt to close out the EXCEL object and release it using...
3
by: Esmael | last post by:
Hi to all... Goodmorning am working on a Project on VB6. THis is an excel automation... the VB6 Program reads from the Excel File and transfer the search data if found to another excel file......
3
by: toffee | last post by:
Hi all, I got a pre-formatted spreadsheet. would it be possible using js to copy the data from a table on the current webpage, open the spreadsheet and paste the content ? if so, anyone got any...
1
by: barnzee | last post by:
Hi all, newbie here, but having a go I am trying to build a stock watchlist in excel 2007 with a dynamic link to a DDE server (paid for from a broker).There is no add-in or plug-in, I just CTL ALT...
18
by: Dirk Hagemann | last post by:
Hello, From a zone-file of a Microsoft Active Directory integrated DNS server I get the date/time of the dynamic update entries in a format, which is as far as I know the hours since january 1st...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
3
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store...
0
by: Belsirk | last post by:
Hi, i'm using C# Visual Studio 2008 for made a apps able to take some information from the app and sending them to a excel template, i'm using Microsoft.Office.Interop.Excel namespace and i don't...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.