Topic Wiki

Rule 1: Did you try A.I? Right before you click post, give it a quick run. Most excel questions can be answered very quickly, thoroughly, and clearly via chatgpt. Wrong answer, or having trouble with the correct wording of the prompt? Post for help

=================
For cool Excel spreadsheet template to keep track of all Credit Card stuff, see here
« Last edited by Jojo202 on March 01, 2024, 12:09:44 AM »

Author Topic: Excel Help and Problems  (Read 291219 times)

Offline skyguy918

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Mar 2011
  • Posts: 4077
  • Total likes: 835
  • DansDeals.com Hat Tips 1
  • Gender: Male
    • View Profile
  • Location: Queens, NY
Re: Excel Problem
« Reply #460 on: December 01, 2015, 07:39:13 PM »
Thanks. I see I need to be more specific and/or clearer. I have uploaded some files to the links below.

In this file is a sample of the raw data as I receive it. I then paste it into this template to calculate which rows are for peak and which are for off-peak with this file as the result. What I am trying to do is get the total peak usage from the last 12 months to be calculated into M6:M17 and the off-peak into N6:N17. One of the criteria of a SUMIF type formula would be that Column E would say "P" or "OP". The real issue is that the dates on the data vary depending on when it was pulled and the most recent 12 months will therefore be different in each data set.

As you will see in the file, when I pasted your formula into excel (I pasted it into the formula area, removed the {}, changed the end of the arrays to be row 20000, and hit CTRL-SHIFT-ENTER) it came up as zero. Not sure if that is because I did something wrong or I was unclear about what I was looking for.
Your sample data ends in the middle of April. So for the April total, do you want only the most recent (partial) April data, the last full April (ie the prior year's) data, or some combination of the 2?

Online aygart

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: May 2008
  • Posts: 18408
  • Total likes: 14582
  • DansDeals.com Hat Tips 14
    • View Profile
    • Lower Watt Energy Brokers
  • Programs: www.lowerwatt.com
Re: Excel Problem
« Reply #461 on: December 01, 2015, 07:45:10 PM »
Your sample data ends in the middle of April. So for the April total, do you want only the most recent (partial) April data, the last full April (ie the prior year's) data, or some combination of the 2?
I would imagine it would be easier to just do complete months and it doesn't really make much of a difference since it is modeled and not exact data anyhow. I am just trying to extract this aspect of the data from the model.
So whatever is simpler.
« Last Edit: December 01, 2015, 08:08:39 PM by aygart »
Feelings don't care about your facts

Offline skyguy918

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Mar 2011
  • Posts: 4077
  • Total likes: 835
  • DansDeals.com Hat Tips 1
  • Gender: Male
    • View Profile
  • Location: Queens, NY
Re: Excel Problem
« Reply #462 on: December 01, 2015, 08:22:19 PM »
I would imagine it would be easier to just do complete months and it doesn't really make much of a difference since it is modeled and not exact data anyhow. I am just trying to extract this aspect of the data from the model.
So whatever is simpler.
Code: [Select]
{=SUM(IF(((MONTH($A$2:$A$20000)=$K6)*(YEAR($A$2:$A$20000)=MAX(IF(MONTH($A$2:$A$20000)=$K6,YEAR($A$2:$A$20000),0)))),F$2:F$20000,0))}Put the numbers 1-12 in Column K next to the month names, and then you can copy the formula as is to the whole table.


Online aygart

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: May 2008
  • Posts: 18408
  • Total likes: 14582
  • DansDeals.com Hat Tips 14
    • View Profile
    • Lower Watt Energy Brokers
  • Programs: www.lowerwatt.com
Re: Excel Problem
« Reply #463 on: December 02, 2015, 11:16:59 AM »
Code: [Select]
{=SUM(IF(((MONTH($A$2:$A$20000)=$K6)*(YEAR($A$2:$A$20000)=MAX(IF(MONTH($A$2:$A$20000)=$K6,YEAR($A$2:$A$20000),0)))),F$2:F$20000,0))}Put the numbers 1-12 in Column K next to the month names, and then you can copy the formula as is to the whole table.


This worked perfectly! Amazing! Thanks tons!

There is no way I would have gotten to this on my own, now I need to figure out what you did so that should be able to do it myself next time.
Feelings don't care about your facts

Offline skyguy918

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Mar 2011
  • Posts: 4077
  • Total likes: 835
  • DansDeals.com Hat Tips 1
  • Gender: Male
    • View Profile
  • Location: Queens, NY
Re: Excel Problem
« Reply #464 on: December 02, 2015, 11:25:09 AM »
This worked perfectly! Amazing! Thanks tons!

There is no way I would have gotten to this on my own, now I need to figure out what you did so that should be able to do it myself next time.
The IF statement says that if a particular row in the array passes the logical test - which I'll explain in the next paragraph - then return the value from the usage column, otherwise return 0. So you get an array that's 19,999 cells, some filled with 0 and some with a usage value, and we sum that array.

The logical test works by 'multiplying' several logical tests by each other. The first parentheses creates a TRUE/FALSE array indicating whether each row is the month you're looking for. The second creates another TRUE/FALSE array indicating whether each row is the year you want (the one that contains the latest instance of the month you're looking for) - which I'll explain in the next paragraph. Multiplying the 2 arrays together results in 1 array that has TRUE only if both of the 'input' arrays are TRUE, and FALSE otherwise.

The year you want is determined by creating an array that's filled with 0 when the month is not the month you're looking for, and with the year where it is the right month. Take the max of that array, and you get the year that contains the latest instance of the month you're looking for.

Offline churnbabychurn

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Jul 2012
  • Posts: 7647
  • Total likes: 301
  • DansDeals.com Hat Tips 0
    • View Profile
  • Location: Lakewood
Re: Excel Problem
« Reply #465 on: December 02, 2015, 11:34:45 AM »
Cool

Online aygart

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: May 2008
  • Posts: 18408
  • Total likes: 14582
  • DansDeals.com Hat Tips 14
    • View Profile
    • Lower Watt Energy Brokers
  • Programs: www.lowerwatt.com
Re: Excel Problem
« Reply #466 on: December 02, 2015, 06:24:00 PM »
The IF statement says that if a particular row in the array passes the logical test - which I'll explain in the next paragraph - then return the value from the usage column, otherwise return 0. So you get an array that's 19,999 cells, some filled with 0 and some with a usage value, and we sum that array.

The logical test works by 'multiplying' several logical tests by each other. The first parentheses creates a TRUE/FALSE array indicating whether each row is the month you're looking for. The second creates another TRUE/FALSE array indicating whether each row is the year you want (the one that contains the latest instance of the month you're looking for) - which I'll explain in the next paragraph. Multiplying the 2 arrays together results in 1 array that has TRUE only if both of the 'input' arrays are TRUE, and FALSE otherwise.

The year you want is determined by creating an array that's filled with 0 when the month is not the month you're looking for, and with the year where it is the right month. Take the max of that array, and you get the year that contains the latest instance of the month you're looking for.
I think I get what you did, but looking at the results more carefully now I see that April is only showing a half month's worth of usage. As I mentioned before it does not make a difference to me if it is, in this example, entirely the previous year meaning 2014, or split between 2015 and 2015. I am trying to play around with the formula but with no success yet.
Feelings don't care about your facts

Offline skyguy918

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Mar 2011
  • Posts: 4077
  • Total likes: 835
  • DansDeals.com Hat Tips 1
  • Gender: Male
    • View Profile
  • Location: Queens, NY
Re: Excel Problem
« Reply #467 on: December 02, 2015, 06:27:00 PM »
I think I get what you did, but looking at the results more carefully now I see that April is only showing a half month's worth of usage. As I mentioned before it does not make a difference to me if it is, in this example, entirely the previous year meaning 2014, or split between 2015 and 2015. I am trying to play around with the formula but with no success yet.
I misunderstood, but that actually makes it easier. Will post tonight.

Offline skyguy918

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Mar 2011
  • Posts: 4077
  • Total likes: 835
  • DansDeals.com Hat Tips 1
  • Gender: Male
    • View Profile
  • Location: Queens, NY
Re: Excel Problem
« Reply #468 on: December 02, 2015, 08:01:44 PM »
I think I get what you did, but looking at the results more carefully now I see that April is only showing a half month's worth of usage. As I mentioned before it does not make a difference to me if it is, in this example, entirely the previous year meaning 2014, or split between 2015 and 2015. I am trying to play around with the formula but with no success yet.
Replacement formula:
Code: [Select]
=SUM(IF((MONTH($A$2:$A$20000)=$K6)*($A$2:$A$20000>$L$5),F$2:F$20000,0)){CTRL-ENTER for array formula}
For which you should add the formula:
Code: [Select]
=EDATE(MAX($A$2:$A$20000),-12)to cell L5.

This solution sums the current fractional April with the other half of the prior April.

Online aygart

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: May 2008
  • Posts: 18408
  • Total likes: 14582
  • DansDeals.com Hat Tips 14
    • View Profile
    • Lower Watt Energy Brokers
  • Programs: www.lowerwatt.com
Re: Excel Problem
« Reply #469 on: December 03, 2015, 03:55:56 PM »
Replacement formula:
Code: [Select]
=SUM(IF((MONTH($A$2:$A$20000)=$K6)*($A$2:$A$20000>$L$5),F$2:F$20000,0)){CTRL-ENTER for array formula}
For which you should add the formula:
Code: [Select]
=EDATE(MAX($A$2:$A$20000),-12)to cell L5.

This solution sums the current fractional April with the other half of the prior April.
Beautiful! Thanks tons!

In the original formula and the first one here the * works like an AND?
Feelings don't care about your facts

Offline skyguy918

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Mar 2011
  • Posts: 4077
  • Total likes: 835
  • DansDeals.com Hat Tips 1
  • Gender: Male
    • View Profile
  • Location: Queens, NY
Re: Excel Problem
« Reply #470 on: December 03, 2015, 04:10:44 PM »
Beautiful! Thanks tons!

In the original formula and the first one here the * works like an AND?
Sort of. MONTH($A$2:$A$20000)=$K6 and $A$2:$A$20000>$L$5 each create an array of TRUE/FALSE values. Multiplying TRUE/FALSE values against each other returns a 1 (which is then treated as a TRUE) or a 0 (which is then treated as a FALSE).

As I'm typing this, I realize that what I just explained means that I can just skip a step:
Code: [Select]
=SUM((MONTH($A$2:$A$20000)=$K6)*($A$2:$A$20000>$L$5)*F$2:F$20000)Because the FALSE values are 0's, they just cancel out the values in that row from the F column.

Online etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12919
  • Total likes: 3373
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Re: Excel Problem
« Reply #471 on: January 11, 2016, 12:05:42 PM »
Weird issue over here - I wrote a simple excel macro, and assigned it to a keyboard shortcut, and it works fine. I also added the macro to the Quick Access Toolbar, but it doesn't do anything when I click it.

Any ideas? Am I losing my marbles?
« Last Edit: January 11, 2016, 12:59:38 PM by etech0 »
Workflowy. You won't know what you're missing until you try it.

Online etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12919
  • Total likes: 3373
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Re: Excel Problem
« Reply #472 on: January 11, 2016, 01:19:31 PM »
Weird issue over here - I wrote a simple excel macro, and assigned it to a keyboard shortcut, and it works fine. I also added the macro to the Quick Access Toolbar, but it doesn't do anything when I click it.

Any ideas? Am I losing my marbles?
Update: here's the answer:

http://answers.microsoft.com/en-us/office/forum/office_2010-customize/at-startup-open-all-files-in-has-stopped-working/0a58f291-15ca-4af5-b5b8-2234e35a67d7?auth=1
Quote
Select File > Options.

Click Add-Ins.

Select Disabled Items from the Manage dropdown, then click Go...

Is the .xlsm listed? If so, select it and click Enable.

Otherwise, see http://www.jkp-ads.com/Articles/StartupProblems.asp.
Workflowy. You won't know what you're missing until you try it.

Offline Zevi16

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Mar 2015
  • Posts: 2161
  • Total likes: 78
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Excel Problem
« Reply #473 on: January 14, 2016, 07:53:35 AM »
Formula for time tracking.  E.g
Time in: 8.00am
Time out: 4.30pm
Total hours : 8hrs 30min.
And then times that by wage. i.e $18 per hour.
=$153.
How can I do all this simply?

Offline MarkS

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2009
  • Posts: 3855
  • Total likes: 70
  • DansDeals.com Hat Tips 5
  • Gender: Male
    • View Profile
Re: Excel Problem
« Reply #474 on: January 14, 2016, 08:04:38 AM »
Formula for time tracking.  E.g
Time in: 8.00am
Time out: 4.30pm
Total hours : 8hrs 30min.
And then times that by wage. i.e $18 per hour.
=$153.
How can I do all this simply?
Assuming that everyone is working morning through  evening,  A1-8.0  B1-4.5   C1- =(12-A1)+B1    D1=C1*18

« Last Edit: January 14, 2016, 09:10:27 AM by MarkS »

Offline lubaby

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Jun 2010
  • Posts: 5386
  • Total likes: 736
  • DansDeals.com Hat Tips 12
    • View Profile
Re: Excel Problem
« Reply #475 on: January 14, 2016, 08:22:52 AM »
Formula for time tracking.  E.g
Time in: 8.00am
Time out: 4.30pm
Total hours : 8hrs 30min.
And then times that by wage. i.e $18 per hour.
=$153.
How can I do all this simply?
Is this just calculating your own hours or for other people as well?

Offline mancunian

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Jul 2008
  • Posts: 1301
  • Total likes: 17
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
Re: Excel Problem
« Reply #476 on: January 14, 2016, 09:36:23 AM »
Google 'excel convert time to decimal' - that's what you need to do, I'm pretty sure its by dividing by 60.
You also want to make sure excel knows if its am or pm, i.e. use the correct formatting.

Offline chucksterace

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Jul 2012
  • Posts: 6890
  • Total likes: 19
  • DansDeals.com Hat Tips 40
  • Gender: Male
    • View Profile
    • LYNX IT Consulting
  • Location: Chicago, Jerusalem
  • Programs: AA Exec Plat; UA Premier 1K; ; LY Plat; Hyatt Platinum; Hertz President's Circle; Avis President's Club
Re: Excel Problem
« Reply #477 on: January 14, 2016, 11:16:59 AM »
Ok. time for a complicated formula request. (if its even possible)

I have two excel sheets with lists of products. Sheet A has the products descriptions and Sheet B doesn't. I want sheet B to compare SKU's in column B with sheet A and if they match to copy a specific cell from Sheet A to Sheet B.

Possible?
You may not hold me responsible for any actions taken that were recommended from my account or username.

Offline MarkS

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Dec 2009
  • Posts: 3855
  • Total likes: 70
  • DansDeals.com Hat Tips 5
  • Gender: Male
    • View Profile
Re: Excel Problem
« Reply #478 on: January 14, 2016, 11:17:59 AM »
Ok. time for a complicated formula request. (if its even possible)

I have two excel sheets with lists of products. Sheet A has the products descriptions and Sheet B doesn't. I want sheet B to compare SKU's in column B with sheet A and if they match to copy a specific cell from Sheet A to Sheet B.

Possible?
Wouldn't a simple V lookup do the trick?

Offline chucksterace

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Jul 2012
  • Posts: 6890
  • Total likes: 19
  • DansDeals.com Hat Tips 40
  • Gender: Male
    • View Profile
    • LYNX IT Consulting
  • Location: Chicago, Jerusalem
  • Programs: AA Exec Plat; UA Premier 1K; ; LY Plat; Hyatt Platinum; Hertz President's Circle; Avis President's Club
Re: Excel Problem
« Reply #479 on: January 14, 2016, 11:18:35 AM »
Wouldn't a simple V lookup do the trick?

Don't know anything about that. But I can take a look.

Really quick response by the way.
You may not hold me responsible for any actions taken that were recommended from my account or username.