Count values in column, multiple criteria

Discuss the spreadsheet application
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Count values in column, multiple criteria

Post by sandromerlino »

Good mornig to all,
I am sorry but I am not English mother tongue so I might make some mistakes in writing or not be very clear.
I use the Italian version of Open Office 4.1.1
I am writing to you to help me to solve this difficult topic.
The file has 3 sheets in 2 langueges.
In the first one:
You switch the language in the cell Q5
from January to December I have in the coloum J the personnel Shifts. It can contain different thinks but I need to count if the language is Italian "chiuso" or if the language is English "close"
In the second one:
You switch the language in the cell Q5
In N104 and Q104 I have 2 targets
In the coloumn H and K I have the Units sold and the Net sales for every day from January to December
In the third one:
In F107 and I107 I have the cells where I would like the formula
In the coloumn D and E there is a small explanation and olso in the coloumn I and J. This is just for january but this is an annual report so the formula should contain the other months calculation.
More details in case is not clear.
In January I am given 1 target for Quantity (d.N104) and 1 for Sales (d.Q104)
Let's take the examples of Quantity but is exactly the same for Sales
My manager want to explain this concept. The 1 January you suppose one flat target per day(risultato2.d111 =risultato2.e111 you have the same value). If the 1 January you sell more Quantity rispect to the flat target per day the target of the 2 January should decrease but he doesn't want to relax the team attention so he still want the flat target in the formula. If the 1 January you sell less Quantity rispect to the flat target per day the target of the 2 January should increase because the store has to take back the gap to reach the target.
This is so on till the end of the month.
This process should be done for February, March, ...., December

For any question please contact me

I enter the file
Thank you
Sandro

 Edit: Changed subject, was Enter the highest value 
Make your post understandable by others 
-- MrProgrammer, forum moderator 
Last edited by MrProgrammer on Wed Mar 08, 2023 11:09 pm, edited 3 times in total.
Reason: Edited topic's subject
openoffice 3.2 - vista
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Good mornig to all,

I cannot enter the file
Can someone explain how to do

Thank you

Sandro
openoffice 3.2 - vista
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Enter the highest value

Post by RusselB »

You state that you can't attach the file.
There are different reasons for this to happen.
The most common is that the file is too big for the forum, which has a 128k maximum file size.
You would've gotten a message stating why the file couldn't be attached.
If the reason is that the file is too big, then upload it to a file sharing service, like MediaFire or Dropbox and supply us with the link to the uploaded file.
Without that file, your explanation is, to me, not clear and would require a lot of back and forth communication to clarify.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear RusselB
Please would you be kind to tell me how i can find MediaFire or Dropbox and address me if there is a password or something else to do
I am sorry

Thank you
Sandro
openoffice 3.2 - vista
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: Enter the highest value

Post by jrkrideau »

LibreOffice 7.3.7. 2; Ubuntu 22.04
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear jrkrideau,
I tried to do what you asked me . Has been very hard. I am not very good at doing this kind of things
Pease check if i did it correctly but if not I ll try again.
The one below should be the link. I cross fingers
https://www.dropbox.com/home?select=sce ... 1+.Eng.ods
email:sandromerlino@gmail.com
password:dropbox

Thank you

Sandro
openoffice 3.2 - vista
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear all,
Please let me know if I have entered the file I was not able to attach in this topic correcly in the Dropbox
It is the first time I have done it and it was very difficult for me so I would like a double check
I used this:
https://www.dropbox.com/home?select=sce ... 1+.Eng.ods
email:sandromerlino@gmail.com
password:dropbox

Thank you

Sandro
openoffice 3.2 - vista
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear all,
Unfortunately I have not got any help since i wrote this post. I do not know why. I might not have been clear
I'll try to split the problem in order to have this time more luck. My boss is complaining because the problem is still at the start point
Please :knock: :knock: :knock:
I would like to find the formula for this problem:
I need to divide the number in R115 by the number of time the range J125:J155 is different from "chiuso" or "close"
In the example:
1000/30
I wrote a formula in V115 but it doesn't work.
Please give me the formula in english and i'll traslate myself

I attach the file

Thank you so much

sandro
Attachments
scelta del valore-01 .Eng - 01.ods
(101.48 KiB) Downloaded 100 times
openoffice 3.2 - vista
User avatar
MrProgrammer
Moderator
Posts: 4905
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Enter the highest value

Post by MrProgrammer »

sandromerlino wrote:the number of time the range J125:J155 is different from "chiuso" or "close"
=SUMPRODUCT(J125:J155<>"chiuso";J125:J155<>"close")
In your example, this formula has the value 30. Since this is to be a divisor, when that formula returns zero, a division will produce #DIV/0!. You may want to test for that case and produce an appropriate result instead of displaying that error.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear, MrProgrammer,
Thank you very much. The formula is perfect
Please I need another formula to solve another part of the problem.
Immagining that i am in January, could you please let me know the formula to calculate the number of time in the range (today:J155) is different from "chiuso" or "close"
For example:
today is the 14/1 the result should be 18 if there is no "chiuso" or "close" otherwise less the number of time it finds it
Consider I cannot change the coloumn F that is set as data.
The file is still the previuos one
Thank you very much for your super prompt previous response

Sandro
Attachments
scelta del valore-01 .Eng - 01.ods
(101.66 KiB) Downloaded 97 times
openoffice 3.2 - vista
User avatar
MrProgrammer
Moderator
Posts: 4905
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Enter the highest value

Post by MrProgrammer »

sandromerlino wrote:Consider I cannot change the coloumn F that is set as data.
sandromerlino wrote:scelta del valore-01 .Eng - 01.ods
Your attachment has #VALUE! errors in column F.
Screen Shot 2018-07-20 at 11.05.56 .png
sandromerlino wrote:let me know the formula to calculate the number of time in the range (today:J155) is different from "chiuso" or "close"
I am not sure I understand the request, but try:
=SUMPRODUCT(J125:J155<>"chiuso";J125:J155<>"close";F125:F155>=TODAY())
Otherwise study Conditional Counting and Summation before posting again.
Cell G126 wrote:
=IF(G125="lun";"mar";IF(G125="mar";"mer";IF(G125="mer";"gio";IF(G125="gio";"ven";IF(G125="ven";"sab";
 IF(G125="sab";"dom";IF(G125="dom";"lun";IF(G125="mon";"tue";IF(G125="tue";"wed";IF(G125="wed";"thu";
 IF(G125="thu";"fri";IF(G125="fri";"sat";IF(G125="sat";"sun";IF(G125="sun";"mon"))))))))))))))
[Tutorial] VLOOKUP questions and answers, Q20/A20
sandromerlino wrote:Enter the highest value
I don't understand how these questions are related to the topic you've used. No one would think to look in topic "Enter the highest value" for advice about conditional counting, though perhaps the confusion is related to being a non-native English speaker. Did you know that we have an Italian forum?

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear MrProgrammer,
Your 2nd formula is perfect and I am so glad that you are helping me in a such way PRECISE anf FAST . My boss is complaining much less.
You know, I might not have been clear in my first post explaining what is in my head . Actually the problem is difficult to explain even in Italian
We are reaching the point bit by bit. I think is better and it takes you not much time I guess
Please,I would like to have from you the last formula that helps me for the whole problem.
This time i attach the second sheet that was in the dropbox. We are going to use the 3rd one for the final formula
Considering that we are in January as before
I would like in the cell H122 for the range H125-H155 the sum of the figures from the first day of the month(H125) to the day before today (TODAY()-1)
Example:
If we are on the 5th of January. I would like the sum of 1-2-3-4 of january so H125-H126-H127-H128

I did my best and i thnk this is the formula. I do not want you to thnk that i just wait for you doing nothing.
Please confirm me that is correct
=SUMPRODUCT(H125:H155;E125:E155=today()-1)


I attach the file

Thank you so much

Sandro
Attachments
scelta del valore-02 .Eng.ods
(126.57 KiB) Downloaded 96 times
openoffice 3.2 - vista
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear MrProgrammer,
I would like to thank you very much for all the partial formulas that you gave me. They are all perfect and I am one step away from the final formula.
If you do not want to help me to find the final formula I respect your decision and I hope you will for another problem

Thank you a lot

sandro
openoffice 3.2 - vista
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Enter the highest value

Post by Villeroy »

10 year old document of mine trying to explain SUMPRODUCT: download/file.php?id=2939
Green columns A2:C51 are random dummy data. They change when you hit Ctrl+Shift+F9.
The subsequent columns calculate the sumproduct of C where A and B are equal to the first pair A2:B2 but without using the SUMPRODUCT function.
D tests if this row's value in A equals A2. This returns TRUE (1) or FALSE (0).
E tests if this row's value in A equals B2. This returns TRUE (1) or FALSE (0).
F calculates the product of D, E and the value in C. If any of the values in C,D,E is zero, the whole product is zero. If both D and E equal 1, then F equals C, otherwise 0.

The red cells indicate numbers >0 by means of conditional formatting.
In F52 you find the sum of all the products in a yellow cell. This is our sumproduct without using SUMPRODUCT.

The other yellow cells show the same results as F52 without referencing any helper columns.
I2 does a SUMPRODUCT the Calc way and subsequent I3, I4, ... does the same thing for each row (sum if A and B equal this row's A and B).
K22 is compatible with Excel.
K23 uses does the same trick as SUMPRODUCT with an array formula summing up products of arrays.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear all,
I hope someone will help me to find the final solution
I attached in my drop box: https://www.dropbox.com/home?select=sce ... 1+.Eng.ods - email:sandromerlino@gmail.com - password:dropbox
A new file named:scelta del valore- Eng-03. I am sorry I did my best to change the italian formulas into english formulas but I did not succeded because when you do it and you save the file, once you close and open the file again the computer rechange all of them.I do not know if you'll find the italian or english formulas.
I'll try to explain again what I have thanks to Mr Programmer.
The sheet to consider is risultato1 where the formulas are.
The file has 3 sheets in 2 langueges.
In the first one (T):
You switch the language in the cell Q5
from January to December I have in the coloum J the personnel Shifts. It can contain different thinks but I need to count if the language is Italian "chiuso" or if the language is English "close"

In the second one(D):
You switch the language in the cell Q5
In N104 and Q104 I have 2 targets for the month of January and so on till arrive N1204 and Q1204
In the coloumn H and K I have the Units sold and the Net sales for every day from January to December

In the third one(risultato1):
In F107 and I107 I have the cells where I would like the formula
In the coloumn D111-D122 I have the result dued to:Target of units sold /number of working days
In the coloumn E111-E122 I have the result dued to:(Target of units sold - number of units sold till yesterday) /number of working days from today to the end of the month
In the coloumn F111-F122 I have the result dued to:higher walue between the 2 number up
In the coloumn G111-G122 I have my way to have the result for each months
I would like you to help me to make one singol formula for the whole year if it is possible instead of having this part (=if(text(today();"mm")="01")that check the month
One more think that my boss does not want is that if the month has no working days and the result is (#div/0) the formula should show 0

If you have any doubt please d not hesitate
I changed this words in the formulas:
DATA-DATE
RIF.RIGA-ROW
GIORNI-DAYS
SE-IF
INDICE-INDEX
GIORNO.SETTIMANA-WEEKDAY
TESTO-TEXT
"ggg"-"ddd"
E-AND
MATR.SOMMA.PRODOTTO-SUMPRODUCT

Thank you

Sandro
openoffice 3.2 - vista
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear all
Please, I ask your help to transform these 12 formulas in one. The poin I am not able to do is to allow the formulas to take the part related to the actual month. I would like to delate this part =if(text(today();"mm")="..." which is repeted 12 times. If you can reduce it more than this is welcome

January

Code: Select all

=if(text(today();"mm")="01";MAX(D.N104/sumproduct(T.J125:J155<>"chiuso";T.J125:J155<>"close");(D.N104-sumproduct(D.H125:H155;D.E125:E155<today()))/sumproduct(T.J125:J155<>"chiuso";T.J125:J155<>"close";T.F125:F155>=today())))
February

Code: Select all

=if(text(today();"mm")="02";MAX(D.N204/(sumproduct(T.J225:J252<>"chiuso";T.J225:J252<>"close")+if(D.H224<>"";sumproduct(T.J253:J253<>"chiuso";T.J253:J253<>"close")));(D.N204-sumproduct(D.H225:H253;D.E225:E253<today()))/(sumproduct(T.J225:J252<>"chiuso";T.J225:J252<>"close";T.F225:F252>=today())+if(D.H224<>"";sumproduct(T.J253:J253<>"chiuso";T.J253:J253<>"close";T.F253:F253>=today())))))
March

Code: Select all

=if(text(today();"mm")="03";MAX(D.N304/sumproduct(T.J325:J355<>"chiuso";T.J325:J355<>"close");(D.N304-sumproduct(D.H325:H355;D.E325:E355<today()))/sumproduct(T.J325:J355<>"chiuso";T.J325:J355<>"close";T.F325:F355>=today())))
April

Code: Select all

=if(text(today();"mm")="04";MAX(D.N404/sumproduct(T.J425:J454<>"chiuso";T.J425:J454<>"close");(D.N404-sumproduct(D.H425:H454;D.E425:E454<today()))/sumproduct(T.J425:J454<>"chiuso";T.J425:J454<>"close";T.F425:F454>=today())))
May

Code: Select all

=if(text(today();"mm")="05";MAX(D.N504/sumproduct(T.J525:J555<>"chiuso";T.J525:J555<>"close");(D.N504-sumproduct(D.H525:H555;D.E525:E555<today()))/sumproduct(T.J525:J555<>"chiuso";T.J525:J555<>"close";T.F525:F555>=today())))
June

Code: Select all

=if(text(today();"mm")="06";MAX(D.N604/sumproduct(T.J625:J654<>"chiuso";T.J625:J654<>"close");(D.N604-sumproduct(D.H625:H654;D.E625:E654<today()))/sumproduct(T.J625:J654<>"chiuso";T.J625:J654<>"close";T.F625:F654>=today())))
July

Code: Select all

=if(text(today();"mm")="07";MAX(D.N704/sumproduct(T.J725:J755<>"chiuso";T.J725:J755<>"close");(D.N704-sumproduct(D.H725:H755;D.E725:E755<today()))/sumproduct(T.J725:J755<>"chiuso";T.J725:J755<>"close";T.F725:F755>=today())))
August

Code: Select all

=if(text(today();"mm")="08";MAX(D.N804/sumproduct(T.J825:J855<>"chiuso";T.J825:J855<>"close");(D.N804-sumproduct(D.H825:H855;D.E825:E855<today()))/sumproduct(T.J825:J855<>"chiuso";T.J825:J855<>"close";T.F825:F855>=today())))
September

Code: Select all

=if(text(today();"mm")="09";MAX(D.N904/sumproduct(T.J925:J954<>"chiuso";T.J925:J954<>"close");(D.N904-sumproduct(D.H925:H954;D.E925:E954<today()))/sumproduct(T.J925:J954<>"chiuso";T.J925:J954<>"close";T.F925:F954>=today())))
October

Code: Select all

=if(text(today();"mm")="10";MAX(D.N1004/sumproduct(T.J1025:J1055<>"chiuso";T.J1025:J1055<>"close");(D.N1004-sumproduct(D.H1025:H1055;D.E1025:E1055<today()))/sumproduct(T.J1025:J1055<>"chiuso";T.J1025:J1055<>"close";T.F1025:F1055>=today())))
November

Code: Select all

=if(text(today();"mm")="11";MAX(D.N1104/sumproduct(T.J1125:J1154<>"chiuso";T.J1125:J1154<>"close");(D.N1104-sumproduct(D.H1125:H1154;D.E1125:E1154<today()))/sumproduct(T.J1125:J1154<>"chiuso";T.J1125:J1154<>"close";T.F1125:F1154>=today())))
December

Code: Select all

=if(text(today();"mm")="12";MAX(D.N1204/sumproduct(T.J1225:J1255<>"chiuso";T.J1225:J1255<>"close");(D.N1204-sumproduct(D.H1225:H1255;D.E1225:E1255<today()))/sumproduct(T.J1225:J1255<>"chiuso";T.J1225:J1255<>"close";T.F1225:F1255>=today())))
Thank you so much in advance

Sandro
openoffice 3.2 - vista
Jeff
Posts: 25
Joined: Sat Apr 25, 2009 12:02 pm
Location: France

Re: Enter the highest value

Post by Jeff »

Hello,

For test, with a define name "NBM" for the month, and "Feb" for februaty formula :

Code: Select all

=IF(NBM<>2;MAX(INDIRECT("D.N"&NBM&"04")/SUMPRODUCT(INDIRECT("T.J"&NBM&"25:J"&NBM&"55")<>"chiuso";INDIRECT("T.J"&NBM&"25:J"&NBM&"55")<>"close");(INDIRECT("D.N"&NBM&"04")-SUMPRODUCT(INDIRECT("D.H"&NBM&"25:H"&NBM&"55");INDIRECT("D.E"&NBM&"25:E"&NBM&"55")<TODAY()))/SUMPRODUCT(INDIRECT("T.J"&NBM&"25:J"&NBM&"55")<>"chiuso";INDIRECT("T.J"&NBM&"25:J"&NBM&"55")<>"close" ;INDIRECT("T.F"&NBM&"25:F"&NBM&"55")>=TODAY()));Feb)
Regards
Attachments
sandromerlino.ods
(12.28 KiB) Downloaded 105 times
AOO 4.1.11 on Windows 10 and Ubuntu 20.04 x64
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Enter the highest value

Post by keme »

sandromerlino wrote:Dear all,
I hope someone will help me to find the final solution
I attached in my drop box: https://www.dropbox.com/home?select=sce ... 1+.Eng.ods - email:sandroxxxxxx@xxxxxx.com - password:xxxxxxx
...
Posting your dropbox login information in public is a VERY bad idea. I suggest you change the password immediately. While it may not seem like a big issue to you at this time, it may in the future be a vehicle for identity theft.

It is much better to share the file publicly. To enable this, you must first provide some proof of identity to Dropbox. This is not a high security identification requirement. A confirmation that you own the email address you have given, is sufficient proof. When done, select the file to share and click the SHARE button that appears to the right on the file entry. Anyone can get the file if they have the link, but the rest of your dropbox content is safe.
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear keme
thank you for your information now is a bit more clear
I still do not understand when you say:
Anyone can get the file if they have the link
.
The link to what?
How can they have the link?
Shall i provide it to them and how?

I am sorry I have never used it and i am totally inexpert

Thank you

sandro
openoffice 3.2 - vista
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Enter the highest value

Post by keme »

When you share the file it is made publicly accessible. If you know "where" to find it, you can download it. The sharing link is that "where" information which you can post here.
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear Jeff
thank you for your reply
I think you consider me very expert and I thank you. The other way round, i am not expert in this field and i some time i do not get the real meaning because of the language.
Anyway i put myself in what i do and i need to solve this time this difficult problem.
When you say:

Code: Select all

For test, with a define name "NBM" for the month, and "Feb" for februaty formula :
i did not understand what is "NBM"
What the formula does ?

Thank you

sandro
openoffice 3.2 - vista
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear Keme
if i understood well, once i enter the file in my dropbox and i push "share" . The expert of this forum are able to find it, isn'it ?
Thank you
sandro
openoffice 3.2 - vista
User avatar
robleyd
Moderator
Posts: 5082
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Enter the highest value

Post by robleyd »

Not unless you post the sharing link.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear robleyd
Could you explain me how to post the sharing link. Please step by step, consider me as i was 10 years old. I want to learn to be able to use this forum
Thank you

sandro
openoffice 3.2 - vista
User avatar
robleyd
Moderator
Posts: 5082
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Enter the highest value

Post by robleyd »

Dropbox will give you a link; you type that link here, or copy and paste here. Like this: http://bfy.tw/JGdr
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear robleyd
I hope this is the correct link:
https://www.dropbox.com/s/g93lj4fnqanz9 ... 3.ods?dl=0
If I need to do anything different please inform me

Thank you

sandro
openoffice 3.2 - vista
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Enter the highest value

Post by keme »

That link works perfectly.

I am not sure that I understand exactly what you ask for. Is it a formula to indicate how current sales compare to budgeted sales (on schedule, ahead or behind) for the current month?

As long as the monthly ranges all laid out identically and each starts at 100*monthnumber, you can probably use OFFSET() to locate the correct month range and DAYSINMONTH() to set the size of the range.

It is still a beast of a formula, but if you really want to do it in one go, this may be what you need:

Code: Select all

=MAX(OFFSET(D.N4;100*MONTH(TODAY());0)/SUMPRODUCT(OFFSET(T.J25;100*MONTH(TODAY());0;DAYSINMONTH(TODAY());1)<>"chiuso";OFFSET(T.J25;100*MONTH(TODAY());0;DAYSINMONTH(TODAY());1)<>"close");OFFSET(D.N4;100*MONTH(TODAY());0)-SUMPRODUCT(OFFSET(D.H25;100*MONTH(TODAY());0;DAYSINMONTH(TODAY());1)<TODAY()))/SUMPRODUCT(OFFSET(T.J25;100*MONTH(TODAY());0;DAYSINMONTH(TODAY());1)<>"chiuso";OFFSET(T.J25;100*MONTH(TODAY());0;DAYSINMONTH(TODAY());1)<>"close")
This type of calculation is easier to do when you have all source data in a single continuous table. Monthly overviews can be made from such a data structure by using conditional/aggregation functions, array formulas, filters or pivot tables.
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear keme,
Thank you for teaching me how to share file in the drop box. I did not have any clue.

About the formula you gave me of course I do not understand how it works because it is very complicate. I do not have enough knowledge but i need to try it.
I think you understood very well but I double check. This is what i need to do every singol month from january to december in the formula

I have a budget and
First step) I need to divide it for the working days of the month and i obtain the constant target for working day(budgeted sales on schedule ahead)
Second step) The constant target for working day changes and become higher if the sales has been less than their forecast and lower if the sales has been high than their forecast (budgeted sales (on schedule behind)

After having found the formulas for these 2 steps we need to compare them and enter the higher value for each day.
Is it what you meant?


Thank you

Sandro
openoffice 3.2 - vista
User avatar
keme
Volunteer
Posts: 3704
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Enter the highest value

Post by keme »

sandromerlino wrote:[...]
First step) I need to divide it for the working days of the month and i obtain the constant target for working day(budgeted sales on schedule ahead)
Second step) The constant target for working day changes and become higher if the sales has been less than their forecast and lower if the sales has been high than their forecast (budgeted sales (on schedule behind)

After having found the formulas for these 2 steps we need to compare them and enter the higher value for each day.
Is it what you meant?
That is close to what I was suspecting.

What I did was to rework your monthly formula so it will always work on current month. The "OFFSET(... ; 100*MONTH(TODAY()) ..." parts take care of that, but this depends on constant 100 row span for each month section, and will break if rows are inserted or deleted within that range.

Test the formula thoroughly before putting it to use. (Create a few different artificial data sets which are easy to compute manually, and see if you get sensible output). I guess it should work exactly like your set of monthly formulas, but it may be better to use them instead. Several formulas of manageable complexity is usually better than to have everything in one single monster formula.
sandromerlino
Posts: 48
Joined: Sat Feb 18, 2012 11:52 pm

Re: Enter the highest value

Post by sandromerlino »

Dear keme
I would like to tell you that i entered your formula in the cell F107 but the result I have is different from the result of my formulas

not finished the reply yet give 5 10 minutes
Last edited by sandromerlino on Wed Aug 08, 2018 2:37 pm, edited 1 time in total.
openoffice 3.2 - vista
Post Reply