-1

For 1 Month low: I tried this Code in Google Sheet does not working

enter code here

=MIN(INDEX(GOOGLEFINANCE("NYSE:UBER","price",DATE(MONTH(TODAY()-30,MONTH(TODAY()),DAY(TODAY())), TODAY()),0,2))

Does not returning any value

  • Your date element is incorrect, I receive an error message that says "Wrong number of arguments to DATE. Expected 3 arguments, but received 2 arguments." – A.Steer Jun 27 '22 at 13:50
  • @A.Steer Can you tell me what is exactly wrong - =MIN(INDEX(GOOGLEFINANCE("NYSE:UBER","price",DATE(MONTH(TODAY()-30,MONTH(TODAY()),DAY(TODAY())), TODAY()),0,2)) – Analytics f Jun 28 '22 at 05:37

1 Answers1

0

When entered into Google sheets your formula comes up with the following error message:

"Wrong number of arguments to DATE. Expected 3 arguments, but received 2 arguments."    

Looking at the formula there are a number of issues -

The date function is being fed three elements, but they do not make up a correct date. The function is being fed the month value twice instead of a year, month, day value.

So

=DATE(MONTH(TODAY()-30,MONTH(TODAY()),DAY(TODAY()))    

should be

=DATE(year(TODAY()),MONTH(TODAY()-30),DAY(TODAY()))    

In your original formula there is also a ) bracket missing as part of the year element of the date formula, so the formula wasen't returning the right number of elements.

When viewing the Google Docs editors help file webpage, if your intention is to return the low value of a stock, you are also using the incorrect attribute element to pull this value out. You have used "price" which returns

‘price’ – Real-time price quote, delayed by up to 20 minutes.

but should be using

'low' – The current day's low price.

Again referancing the Google Docs editors help file webpage you can also shorten your date element to only use the TODAY()-30 element instead of entering the a full date string.

As such your origional formula can be changed from:

=MIN(INDEX(GOOGLEFINANCE("NYSE:UBER","price",DATE(MONTH(TODAY()-30,MONTH(TODAY()),DAY(TODAY())), TODAY()),0,2))

to

=MIN(INDEX(GOOGLEFINANCE("NYSE:UBER","price",MONTH(TODAY()-30), TODAY()),0,2))
A.Steer
  • 335
  • 3
  • 14